summaryrefslogtreecommitdiff
path: root/feedlist.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-28 06:05:45 +0100
committerAndrew Dolgov <[email protected]>2007-08-28 06:05:45 +0100
commit82764a41dd0ef3200700ed95a89aec91465ebe7b (patch)
treefa0b21f7c0f57de086fe754cf3ce7616850a108e /feedlist.js
parenta10d293c44e9d6d2e17f9756ec9e412ac69bf811 (diff)
rework infinite scroll request synchronization
Diffstat (limited to 'feedlist.js')
-rw-r--r--feedlist.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/feedlist.js b/feedlist.js
index a8c1cd5c8..774c4d2e2 100644
--- a/feedlist.js
+++ b/feedlist.js
@@ -1,5 +1,6 @@
var _feed_cur_page = 0;
var _infscroll_disable = 0;
+var _infscroll_request_sent = 0;
function viewCategory(cat) {
active_feed_is_cat = true;
@@ -53,6 +54,20 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
_infscroll_disable = 0;
}
+ if (page_offset != 0 && !subop) {
+ var date = new Date();
+ var timestamp = Math.round(date.getTime() / 1000);
+
+ debug("<b>" + _infscroll_request_sent + " : " + timestamp + "</b>");
+
+ if (_infscroll_request_sent && _infscroll_request_sent + 30 > timestamp) {
+ debug("infscroll request in progress, aborting");
+ return;
+ }
+
+ _infscroll_request_sent = timestamp;
+ }
+
enableHotkeys();
closeInfoBox();
@@ -134,7 +149,6 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
}
new Ajax.Request(query, {
- asynchronous: page_offset == 0,
onComplete: function(transport) {
headlines_callback2(transport, feed, is_cat, page_offset);
} });