Add: Scroll handler

pull/16/head
Juraj Nyíri 4 years ago
parent 4261b304e3
commit 0828f1c2d5

@ -19624,6 +19624,12 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.previousPositions = [];
this.contentBGHeight = 0;
this.loadInitialData = async () => {
window.addEventListener('scroll', () => {
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) {
console.log('scrolled');
}
});
this.loading = true;
this.renderPage();
try {

@ -98,6 +98,18 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}
loadInitialData = async (): Promise<void> => {
window.addEventListener('scroll', () => {
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) {
console.log('scrolled');
}
});
this.loading = true;
this.renderPage();
try {

Loading…
Cancel
Save