From e56475aa1d0b3cc35ad00e2a67466549692aa646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Tue, 15 Jun 2021 15:34:48 +0200 Subject: [PATCH] Fix: Enable scroll when user moves to a different tab --- dist/plex-meets-homeassistant.js | 3 +-- src/plex-meets-homeassistant.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index a32855b..292aa5a 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20047,7 +20047,6 @@ class PlexMeetsHomeAssistant extends HTMLElement { }); const detailTop = parseInt(getOffset(activeElem).top, 10) - 70; const detailBottom = getDetailsBottom(seasonContainers, episodeContainers, activeElem); - console.log(this); if (this.getTop() < detailTop) { window.scroll({ top: detailTop @@ -20063,7 +20062,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.children[0].classList.add('stop-scrolling'); } } - else { + else if (detailTop !== -70 && detailBottom !== -10) { window.scroll({ top: detailTop }); diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 1282dfe..2f8d0eb 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -167,7 +167,6 @@ class PlexMeetsHomeAssistant extends HTMLElement { const detailTop = parseInt(getOffset(activeElem as Element).top, 10) - 70; const detailBottom = getDetailsBottom(seasonContainers, episodeContainers, activeElem); - console.log(this); if (this.getTop() < detailTop) { window.scroll({ top: detailTop @@ -181,7 +180,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { }); this.children[0].classList.add('stop-scrolling'); } - } else { + } else if (detailTop !== -70 && detailBottom !== -10) { window.scroll({ top: detailTop });