|
|
@ -19629,7 +19629,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
const loadAdditionalRowsCount = 2; // todo: make this configurable
|
|
|
|
const loadAdditionalRowsCount = 2; // todo: make this configurable
|
|
|
|
const height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
|
|
|
const height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
|
|
|
if (window.innerHeight + window.scrollY > height - 300) {
|
|
|
|
if (window.innerHeight + window.scrollY > height - 300 && this.renderedItems > 0) {
|
|
|
|
this.maxRenderCount = this.renderedItems - 1 + this.columnsCount * (loadAdditionalRowsCount * 2);
|
|
|
|
this.maxRenderCount = this.renderedItems - 1 + this.columnsCount * (loadAdditionalRowsCount * 2);
|
|
|
|
this.renderMovieElems();
|
|
|
|
this.renderMovieElems();
|
|
|
|
this.calculatePositions();
|
|
|
|
this.calculatePositions();
|
|
|
@ -19749,9 +19749,8 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
this.columnsCount = this.renderedItems - 1;
|
|
|
|
this.columnsCount = this.renderedItems - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lastRowTop = movieElem.getBoundingClientRect().top;
|
|
|
|
lastRowTop = movieElem.getBoundingClientRect().top;
|
|
|
|
if (!isScrolledIntoView(movieElem) && !this.maxRenderCount) {
|
|
|
|
if (!isScrolledIntoView(movieElem) && !this.maxRenderCount && this.renderedItems > 0) {
|
|
|
|
this.maxRenderCount = this.renderedItems - 1 + this.columnsCount * loadAdditionalRowsCount;
|
|
|
|
this.maxRenderCount = this.renderedItems - 1 + this.columnsCount * loadAdditionalRowsCount;
|
|
|
|
console.log(`Set max render this.renderedItems to ${this.maxRenderCount}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|