Add: Disable scrolling above details element top when opened

pull/16/head
Juraj Nyíri 4 years ago
parent 12cba398b4
commit bdbaac382f

@ -20015,6 +20015,13 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}; };
this.loadInitialData = async () => { this.loadInitialData = async () => {
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
if (this.detailsShown &&
this.activeMovieElem &&
this.getTop() + 15 < parseInt(this.activeMovieElem.style.top, 10)) {
window.scroll({
top: getOffset(this.activeMovieElem).top - 80
});
}
this.renderNewElementsIfNeeded(); this.renderNewElementsIfNeeded();
}); });
window.addEventListener('resize', () => { window.addEventListener('resize', () => {

@ -149,6 +149,15 @@ class PlexMeetsHomeAssistant extends HTMLElement {
loadInitialData = async (): Promise<void> => { loadInitialData = async (): Promise<void> => {
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
if (
this.detailsShown &&
this.activeMovieElem &&
this.getTop() + 15 < parseInt(this.activeMovieElem.style.top, 10)
) {
window.scroll({
top: getOffset(this.activeMovieElem as Element).top - 80
});
}
this.renderNewElementsIfNeeded(); this.renderNewElementsIfNeeded();
}); });
window.addEventListener('resize', () => { window.addEventListener('resize', () => {

Loading…
Cancel
Save