fix travel forecast and hourly scrolling close #58

This commit is contained in:
Matt Walsh
2024-11-25 09:40:36 -06:00
parent e2d7a96971
commit efeb45d3d0
2 changed files with 2 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;