diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 13bd535..dda11ab 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20047,12 +20047,19 @@ class PlexMeetsHomeAssistant extends HTMLElement { top: detailTop }); } - else if (detailBottom && - window.innerHeight < detailBottom - detailTop && - this.getTop() + window.innerHeight > detailBottom) { - window.scroll({ - top: detailBottom - window.innerHeight - }); + else if (detailBottom) { + if (window.innerHeight < detailBottom - detailTop) { + if (detailBottom && this.getTop() + window.innerHeight > detailBottom) { + window.scroll({ + top: detailBottom - window.innerHeight + }); + } + } + else { + window.scroll({ + top: detailTop + }); + } } } this.renderNewElementsIfNeeded(); diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 2f19741..1a4284d 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -170,14 +170,18 @@ class PlexMeetsHomeAssistant extends HTMLElement { window.scroll({ top: detailTop }); - } else if ( - detailBottom && - window.innerHeight < detailBottom - detailTop && - this.getTop() + window.innerHeight > detailBottom - ) { - window.scroll({ - top: detailBottom - window.innerHeight - }); + } else if (detailBottom) { + if (window.innerHeight < detailBottom - detailTop) { + if (detailBottom && this.getTop() + window.innerHeight > detailBottom) { + window.scroll({ + top: detailBottom - window.innerHeight + }); + } + } else { + window.scroll({ + top: detailTop + }); + } } }