summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
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;