|
|
|
@ -19629,7 +19629,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
|
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);
|
|
|
|
|
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.renderMovieElems();
|
|
|
|
|
this.calculatePositions();
|
|
|
|
@ -19749,9 +19749,8 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
|
this.columnsCount = this.renderedItems - 1;
|
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
console.log(`Set max render this.renderedItems to ${this.maxRenderCount}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|