This commit is contained in:
2026-07-12 20:15:39 +02:00
parent 6c926a2374
commit 38f5c9d6fe

View File

@@ -71,12 +71,19 @@ if (!window.UserCommentSystem) {
} }
bindEvents() { bindEvents() {
let _rafPending = false;
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
if (this.loading || this.finished) return; if (this.loading || this.finished) return;
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 500) { if (_rafPending) return;
this.loadMore(); _rafPending = true;
} requestAnimationFrame(() => {
}); _rafPending = false;
if (this.loading || this.finished) return;
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 500) {
this.loadMore();
}
});
}, { passive: true });
// Listen for mode changes // Listen for mode changes
document.addEventListener('f0ck:modeChange', (e) => { document.addEventListener('f0ck:modeChange', (e) => {