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