summaryrefslogtreecommitdiffstats
path: root/js/app/directives/itemshortcuts.coffee
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-08-14 12:15:19 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-08-14 12:15:19 +0200
commit259dcbe5a0179582988c50cfaea77b68af10bb9d (patch)
tree5fb6a331f22fff41ffdd257e720d14d1435c5e9e /js/app/directives/itemshortcuts.coffee
parent4a20d87d1654b364cda7ce42f68ea5506f473147 (diff)
When jumping to the next item after the last one, also mark the last item as read, fix #213
Diffstat (limited to 'js/app/directives/itemshortcuts.coffee')
-rw-r--r--js/app/directives/itemshortcuts.coffee7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/app/directives/itemshortcuts.coffee b/js/app/directives/itemshortcuts.coffee
index 076da571e..d78af0c15 100644
--- a/js/app/directives/itemshortcuts.coffee
+++ b/js/app/directives/itemshortcuts.coffee
@@ -52,11 +52,18 @@ angular.module('News').directive 'itemShortcuts', ['$window', ($window) ->
jumpToNextItem = (scrollArea) ->
$scrollArea = $(scrollArea)
$items = $scrollArea.find('.feed_item')
+ jumped = false
for item in $items
$item = $(item)
if $item.position().top > 1
+ jumped = true
jumpTo($scrollArea, $item)
break
+ # in case this is the last item it should still scroll below the
+ # top
+ if jumped == false
+ $scrollArea.scrollTop($scrollArea.prop('scrollHeight'))
+
getCurrentItem = (scrollArea) ->