]> git.wh0rd.org Git - tt-rss.git/commitdiff
js: remove current_top_id global
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 12 Jul 2015 10:30:00 +0000 (13:30 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 12 Jul 2015 10:30:00 +0000 (13:30 +0300)
js/feedlist.js
js/viewfeed.js

index ffcecc7c4650e1a070bd115adf62bdef7abb0352..54ad1cc5023ef5ea1f8eeba204c1e31f838f64c0 100644 (file)
@@ -99,8 +99,12 @@ function viewfeed(feed, method, is_cat, offset, background, infscroll_req, can_w
                        query = query + "&m=" + param_escape(method);
                }
 
-               if (current_top_article_id && offset > 0) {
-                       query = query + "&topid=" + param_escape(current_top_article_id);
+               if (offset > 0) {
+                       var firstRow = $$('div[id*="RROW-"]').first();
+
+                       if (firstRow) {
+                               query = query + "&topid=" + param_escape(parseInt(firstRow.id.replace("RROW-", "")));
+                       }
                }
 
                if (!background) {
index b4bf69a7e1f5de3c101bbbc5b1d0c09f75a44df9..5c437c7b8c802e47b2bf1ef1dcfe189e655f4a59 100644 (file)
@@ -13,7 +13,6 @@ var catchup_timeout_id = false;
 var cids_requested = [];
 var loaded_article_ids = [];
 var _last_headlines_update = 0;
-var current_top_article_id = false;
 
 var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
 
@@ -84,7 +83,6 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
                        if (infscroll_req == false) {
                                loaded_article_ids = [];
-                               current_top_article_id = false;
 
                                dijit.byId("headlines-frame").attr('content',
                                        reply['headlines']['content']);
@@ -104,10 +102,6 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
                                        }
                                });
 
-                               if (loaded_article_ids.size() > 0) {
-                                       current_top_article_id = parseInt(loaded_article_ids[0].replace("RROW-", ""));
-                               }
-
                                var hsp = $("headlines-spacer");
                                if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
                                dijit.byId('headlines-frame').domNode.appendChild(hsp);