aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-03-09 19:15:46 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-03-09 19:15:46 +0100
commit54a86990e674a529db028a2240ba73237ae55f09 (patch)
tree2654e7802ef915ffef868f9ab1b1e18d7ca53fec /p/scripts
parentced6469e231891abf427adda69fffe87f65ede28 (diff)
Improved auto load more articles
Fixed bug + ealier trigger of load more (half of the window height instead of 0)
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 90a41d767..521adc839 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -592,9 +592,9 @@ function onScroll() {
}
}
if (context.auto_load_more) {
- const load_more = document.getElementById('mark-read-pagination');
- if (load_more && box_to_follow.scrollTop > 0 &&
- box_to_follow.scrollTop + box_to_follow.offsetHeight >= load_more.offsetTop) {
+ const pagination = document.getElementById('mark-read-pagination');
+ if (pagination && box_to_follow.offsetHeight > 0 &&
+ box_to_follow.scrollTop + box_to_follow.offsetHeight + (window.innerHeight / 2) >= pagination.offsetTop) {
load_more_posts();
}
}