summaryrefslogtreecommitdiffstats
path: root/js/app/directives/newsitemscroll.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'js/app/directives/newsitemscroll.coffee')
-rw-r--r--js/app/directives/newsitemscroll.coffee8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/app/directives/newsitemscroll.coffee b/js/app/directives/newsitemscroll.coffee
index 5e7e42a3e..619710bf3 100644
--- a/js/app/directives/newsitemscroll.coffee
+++ b/js/app/directives/newsitemscroll.coffee
@@ -49,14 +49,18 @@ angular.module('News').directive 'newsItemScroll', ['$rootScope', 'Config',
offset = $(feedItem).position().top
if offset <= -50
id = parseInt($(feedItem).data('id'), 10)
- #$rootScope.$broadcast 'readItem', id
+ $rootScope.$broadcast 'readItem', id
else
break
, Config.MarkReadTimeout
- scope.$apply attr.newsItemScroll
+ # autopaging
+ tolerance = elm.height() * Config.autoPageFactor
+ remaining = elm[0].scrollHeight - elm.scrollTop() - tolerance
+ if remaining <= 0
+ $rootScope.$broadcast 'autoPage'
]