From 259dcbe5a0179582988c50cfaea77b68af10bb9d Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 14 Aug 2013 12:15:19 +0200 Subject: When jumping to the next item after the last one, also mark the last item as read, fix #213 --- js/app/directives/itemshortcuts.coffee | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'js/app/directives/itemshortcuts.coffee') 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) -> -- cgit v1.2.3