From efeb45d3d0f8e107740064600c51c894ea370f1d Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Mon, 25 Nov 2024 09:40:36 -0600 Subject: [PATCH] fix travel forecast and hourly scrolling close #58 --- server/scripts/modules/hourly.mjs | 2 +- server/scripts/modules/travelforecast.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/scripts/modules/hourly.mjs b/server/scripts/modules/hourly.mjs index 819b4e2..a04f59d 100644 --- a/server/scripts/modules/hourly.mjs +++ b/server/scripts/modules/hourly.mjs @@ -109,7 +109,7 @@ class Hourly extends WeatherDisplay { // base count change callback baseCountChange(count) { // calculate scroll offset and don't go past end - let offsetY = Math.min(this.elem.querySelector('.hourly-lines').getBoundingClientRect().height - 289, (count - 150)); + let offsetY = Math.min(this.elem.querySelector('.hourly-lines').offsetHeight - 289, (count - 150)); // don't let offset go negative if (offsetY < 0) offsetY = 0; diff --git a/server/scripts/modules/travelforecast.mjs b/server/scripts/modules/travelforecast.mjs index a5a8144..8eaabf7 100644 --- a/server/scripts/modules/travelforecast.mjs +++ b/server/scripts/modules/travelforecast.mjs @@ -131,7 +131,7 @@ class TravelForecast extends WeatherDisplay { // base count change callback baseCountChange(count) { // calculate scroll offset and don't go past end - let offsetY = Math.min(this.elem.querySelector('.travel-lines').getBoundingClientRect().height - 289, (count - 150)); + let offsetY = Math.min(this.elem.querySelector('.travel-lines').offsetHeight - 289, (count - 150)); // don't let offset go negative if (offsetY < 0) offsetY = 0;