Add: Disable scroll on details when not needed

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

@ -20047,14 +20047,21 @@ class PlexMeetsHomeAssistant extends HTMLElement {
top: detailTop
});
}
else if (detailBottom &&
window.innerHeight < detailBottom - detailTop &&
this.getTop() + window.innerHeight > detailBottom) {
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();
});
window.addEventListener('resize', () => {

@ -170,15 +170,19 @@ class PlexMeetsHomeAssistant extends HTMLElement {
window.scroll({
top: detailTop
});
} else if (
detailBottom &&
window.innerHeight < detailBottom - detailTop &&
this.getTop() + window.innerHeight > detailBottom
) {
} 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();

Loading…
Cancel
Save