pull/16/head
Juraj Nyíri 3 years ago
parent 35e588831e
commit 8f784d0732

@ -19695,6 +19695,10 @@ style.textContent = css `
top: 0; top: 0;
background-size: cover; background-size: cover;
} }
.stop-scrolling {
height: 100%;
overflow: hidden;
}
.contentArt { .contentArt {
position: absolute; position: absolute;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
@ -20042,10 +20046,12 @@ 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
}); });
this.children[0].classList.add('stop-scrolling');
} }
else if (detailBottom) { else if (detailBottom) {
if (window.innerHeight < detailBottom - detailTop) { if (window.innerHeight < detailBottom - detailTop) {
@ -20053,12 +20059,14 @@ class PlexMeetsHomeAssistant extends HTMLElement {
window.scroll({ window.scroll({
top: detailBottom - window.innerHeight top: detailBottom - window.innerHeight
}); });
this.children[0].classList.add('stop-scrolling');
} }
} }
else { else {
window.scroll({ window.scroll({
top: detailTop top: detailTop
}); });
this.children[0].classList.add('stop-scrolling');
} }
} }
} }

@ -182,6 +182,10 @@ style.textContent = css`
top: 0; top: 0;
background-size: cover; background-size: cover;
} }
.stop-scrolling {
height: 100%;
overflow: hidden;
}
.contentArt { .contentArt {
position: absolute; position: absolute;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);

@ -165,22 +165,25 @@ 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
}); });
this.children[0].classList.add('stop-scrolling');
} else if (detailBottom) { } else if (detailBottom) {
if (window.innerHeight < detailBottom - detailTop) { if (window.innerHeight < detailBottom - detailTop) {
if (detailBottom && this.getTop() + window.innerHeight > detailBottom) { if (detailBottom && this.getTop() + window.innerHeight > detailBottom) {
window.scroll({ window.scroll({
top: detailBottom - window.innerHeight top: detailBottom - window.innerHeight
}); });
this.children[0].classList.add('stop-scrolling');
} }
} else { } else {
window.scroll({ window.scroll({
top: detailTop top: detailTop
}); });
this.children[0].classList.add('stop-scrolling');
} }
} }
} }

Loading…
Cancel
Save