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/public/app.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'js/public') diff --git a/js/public/app.js b/js/public/app.js index 39cd509c4..33c54c0e5 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -225,21 +225,22 @@ License along with this library. If not, see . } }; jumpToNextItem = function(scrollArea) { - var $item, $items, $scrollArea, item, _i, _len, _results; + var $item, $items, $scrollArea, item, jumped, _i, _len; $scrollArea = $(scrollArea); $items = $scrollArea.find('.feed_item'); - _results = []; + jumped = false; for (_i = 0, _len = $items.length; _i < _len; _i++) { item = $items[_i]; $item = $(item); if ($item.position().top > 1) { + jumped = true; jumpTo($scrollArea, $item); break; - } else { - _results.push(void 0); } } - return _results; + if (jumped === false) { + return $scrollArea.scrollTop($scrollArea.prop('scrollHeight')); + } }; getCurrentItem = function(scrollArea) { var $item, $items, $scrollArea, item, _i, _len; -- cgit v1.2.3