summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-09-05 09:44:17 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-09-05 09:54:36 +0200
commite02e6705c08d05718bca0a04f26930397e432f9d (patch)
treedaaef9ae90a8c4db646f46bde8ed2e19f67006db /js
parent4bf41aa49e52b65ca282047888b196c1ae362690 (diff)
Use bottom of article
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'js')
-rw-r--r--js/directive/NewsScroll.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/directive/NewsScroll.js b/js/directive/NewsScroll.js
index 552c7411f..44271b72b 100644
--- a/js/directive/NewsScroll.js
+++ b/js/directive/NewsScroll.js
@@ -47,10 +47,11 @@ app.directive('newsScroll', function ($timeout, ITEM_AUTO_PAGE_SIZE,
var articles = elem.querySelectorAll('.item:not(.read)');
articles.forEach(function(article) {
- var distTop = article.offsetTop;
+ // distance to top + height
+ var distTop = article.offsetTop + article.offsetHeight;
var scrollTop = window.pageYOffset ||
document.documentElement.scrollTop;
- if (distTop < scrollTop - 50) {
+ if (distTop < scrollTop) {
ids.push(parseInt(article.dataset.id, 10));
} else {
return false;