Add: Disable scroll on details when not needed

pull/16/head
Juraj Nyíri 4 years ago
parent f21a99421e
commit 35e588831e

@ -20047,12 +20047,19 @@ class PlexMeetsHomeAssistant extends HTMLElement {
top: detailTop top: detailTop
}); });
} }
else if (detailBottom && else if (detailBottom) {
window.innerHeight < detailBottom - detailTop && if (window.innerHeight < detailBottom - detailTop) {
this.getTop() + window.innerHeight > detailBottom) { if (detailBottom && this.getTop() + window.innerHeight > detailBottom) {
window.scroll({ window.scroll({
top: detailBottom - window.innerHeight top: detailBottom - window.innerHeight
}); });
}
}
else {
window.scroll({
top: detailTop
});
}
} }
} }
this.renderNewElementsIfNeeded(); this.renderNewElementsIfNeeded();

@ -170,14 +170,18 @@ class PlexMeetsHomeAssistant extends HTMLElement {
window.scroll({ window.scroll({
top: detailTop top: detailTop
}); });
} else if ( } else if (detailBottom) {
detailBottom && if (window.innerHeight < detailBottom - detailTop) {
window.innerHeight < detailBottom - detailTop && if (detailBottom && this.getTop() + window.innerHeight > detailBottom) {
this.getTop() + window.innerHeight > detailBottom window.scroll({
) { top: detailBottom - window.innerHeight
window.scroll({ });
top: detailBottom - window.innerHeight }
}); } else {
window.scroll({
top: detailTop
});
}
} }
} }

Loading…
Cancel
Save