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.previousPositions = [];
this.contentBGHeight = 0; this.contentBGHeight = 0;
this.loadInitialData = async () => { 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.loading = true;
this.renderPage(); this.renderPage();
try { try {

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

Loading…
Cancel
Save