summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-07-12 01:29:36 +0300
committerAndrew Dolgov <[email protected]>2015-07-12 01:29:36 +0300
commitf5a0fb8b64c57e98fcf73369cb4dbb1b31620fd7 (patch)
treef6b45118a07f3899997beba7848d522140edc44a /js
parent5f297a5c111e3abecd143b6412a753ea870e4f20 (diff)
queryFeedHeadlines: move to array-based arguments, optionally check if first element changed when paginating
Diffstat (limited to 'js')
-rw-r--r--js/feedlist.js4
-rw-r--r--js/viewfeed.js6
2 files changed, 10 insertions, 0 deletions
diff --git a/js/feedlist.js b/js/feedlist.js
index 7c2e08052..ffcecc7c4 100644
--- a/js/feedlist.js
+++ b/js/feedlist.js
@@ -99,6 +99,10 @@ 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 (!background) {
if (_search_query) {
force_nocache = true;
diff --git a/js/viewfeed.js b/js/viewfeed.js
index e346b2967..8bc42aadc 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -13,6 +13,7 @@ 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;
@@ -83,6 +84,7 @@ 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']);
@@ -102,6 +104,10 @@ 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);