diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index d31ef40..b353b09 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -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 { diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index fd3c82c..78c54ff 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -98,6 +98,18 @@ class PlexMeetsHomeAssistant extends HTMLElement { } loadInitialData = async (): Promise => { + 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 {