Fix: Enable scroll when user moves to a different tab

pull/16/head 1.1.0
Juraj Nyíri 3 years ago
parent 1354c4bab5
commit e56475aa1d

@ -20047,7 +20047,6 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}); });
const detailTop = parseInt(getOffset(activeElem).top, 10) - 70; const detailTop = parseInt(getOffset(activeElem).top, 10) - 70;
const detailBottom = getDetailsBottom(seasonContainers, episodeContainers, activeElem); const detailBottom = getDetailsBottom(seasonContainers, episodeContainers, activeElem);
console.log(this);
if (this.getTop() < detailTop) { if (this.getTop() < detailTop) {
window.scroll({ window.scroll({
top: detailTop top: detailTop
@ -20063,7 +20062,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.children[0].classList.add('stop-scrolling'); this.children[0].classList.add('stop-scrolling');
} }
} }
else { else if (detailTop !== -70 && detailBottom !== -10) {
window.scroll({ window.scroll({
top: detailTop top: detailTop
}); });

@ -167,7 +167,6 @@ class PlexMeetsHomeAssistant extends HTMLElement {
const detailTop = parseInt(getOffset(activeElem as Element).top, 10) - 70; const detailTop = parseInt(getOffset(activeElem as Element).top, 10) - 70;
const detailBottom = getDetailsBottom(seasonContainers, episodeContainers, activeElem); const detailBottom = getDetailsBottom(seasonContainers, episodeContainers, activeElem);
console.log(this);
if (this.getTop() < detailTop) { if (this.getTop() < detailTop) {
window.scroll({ window.scroll({
top: detailTop top: detailTop
@ -181,7 +180,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}); });
this.children[0].classList.add('stop-scrolling'); this.children[0].classList.add('stop-scrolling');
} }
} else { } else if (detailTop !== -70 && detailBottom !== -10) {
window.scroll({ window.scroll({
top: detailTop top: detailTop
}); });

Loading…
Cancel
Save