summaryrefslogtreecommitdiffstats
path: root/js/app/directives
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-16 15:19:05 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-16 15:23:12 +0200
commitdee17d002d87667f7d0f4478e1f0180135618c38 (patch)
treed71c6896bd558b28fa16af0c424b2f4d1aca768c /js/app/directives
parent8df6d36d49d89f3bb7186b36436606adb039b3f8 (diff)
dont show unread count when it is 0, dont bold read feeds, implemented autopaging
Diffstat (limited to 'js/app/directives')
-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'
]