]> git.wh0rd.org Git - tt-rss.git/commitdiff
small tweak for loadMoreHeadlines() algorithm
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 16 Aug 2012 15:11:39 +0000 (19:11 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 16 Aug 2012 15:11:39 +0000 (19:11 +0400)
js/feedlist.js

index f915bce5eb987624b5b6ae434a7966bdacf9b293..3769eb6236b5241c216853c4b9b0efb1e74a1a37 100644 (file)
@@ -19,7 +19,8 @@ function loadMoreHeadlines() {
                var offset = 0;
 
                var view_mode = document.forms["main_toolbar_form"].view_mode.value;
-               var num_unread = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
+               var num_unread = getFeedUnread(getActiveFeedId(), activeFeedIsCat());
+               var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
                var num_all = $$("#headlines-frame > div[id*=RROW]").length;
 
                // TODO implement marked & published
@@ -34,7 +35,7 @@ function loadMoreHeadlines() {
                        offset = num_unread;
                } else if (view_mode == "adaptive") {
                        if (num_unread > 0)
-                               offset = num_unread;
+                               offset = unread_in_buffer;
                        else
                                offset = num_all;
                } else {