|
|
@ -105,13 +105,13 @@ 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(
|
|
|
|
const height = Math.max(
|
|
|
|
document.body.scrollHeight,
|
|
|
|
this.content.scrollHeight,
|
|
|
|
document.body.offsetHeight,
|
|
|
|
this.content.offsetHeight,
|
|
|
|
document.documentElement.clientHeight,
|
|
|
|
this.content.clientHeight,
|
|
|
|
document.documentElement.scrollHeight,
|
|
|
|
this.content.scrollHeight,
|
|
|
|
document.documentElement.offsetHeight
|
|
|
|
this.content.offsetHeight
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if (window.innerHeight + window.scrollY > height - 300 && this.renderedItems > 0) {
|
|
|
|
if (window.innerHeight + window.scrollY > height + getOffset(this.content).top - 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();
|
|
|
|