summaryrefslogtreecommitdiffstats
path: root/js/app/directives/itemshortcuts.coffee
diff options
context:
space:
mode:
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) ->