|
|
@ -19726,15 +19726,21 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
this.error = '';
|
|
|
|
this.error = '';
|
|
|
|
this.previousPositions = [];
|
|
|
|
this.previousPositions = [];
|
|
|
|
this.contentBGHeight = 0;
|
|
|
|
this.contentBGHeight = 0;
|
|
|
|
this.loadInitialData = async () => {
|
|
|
|
this.renderNewElementsIfNeeded = () => {
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
|
|
|
|
const loadAdditionalRowsCount = 2; // todo: make this configurable
|
|
|
|
const loadAdditionalRowsCount = 2; // todo: make this configurable
|
|
|
|
const height = getHeight(this.content);
|
|
|
|
const height = getHeight(this.content);
|
|
|
|
if (window.innerHeight + window.scrollY > height + getOffset(this.content).top - 300 && this.renderedItems > 0) {
|
|
|
|
if (this.detailElem &&
|
|
|
|
|
|
|
|
(this.detailElem.style.visibility === 'hidden' || this.detailElem.style.visibility === '') &&
|
|
|
|
|
|
|
|
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();
|
|
|
|
this.calculatePositions();
|
|
|
|
this.calculatePositions();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
this.loadInitialData = async () => {
|
|
|
|
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
|
|
|
|
this.renderNewElementsIfNeeded();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
this.renderPage();
|
|
|
|
this.renderPage();
|
|
|
@ -20073,6 +20079,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
this.detailElem.style.zIndex = '0';
|
|
|
|
this.detailElem.style.zIndex = '0';
|
|
|
|
this.detailElem.style.visibility = 'hidden';
|
|
|
|
this.detailElem.style.visibility = 'hidden';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.renderNewElementsIfNeeded();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.showDetails = async (data) => {
|
|
|
|
this.showDetails = async (data) => {
|
|
|
|
const top = this.getTop();
|
|
|
|
const top = this.getTop();
|
|
|
|