fix local forecast pagination when full screen

This commit is contained in:
Matt Walsh
2023-09-20 15:36:22 -05:00
parent e9b0bef023
commit 7a457745df
8 changed files with 3106 additions and 2828 deletions

View File

@@ -44,7 +44,7 @@ class LocalForecast extends WeatherDisplay {
forecastsElem.append(...templates);
// increase each forecast height to a multiple of container height
this.pageHeight = forecastsElem.parentNode.getBoundingClientRect().height;
this.pageHeight = forecastsElem.parentNode.scrollHeight;
templates.forEach((forecast) => {
const newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight;
forecast.style.height = `${newHeight}px`;