summaryrefslogtreecommitdiff
path: root/js/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2013-04-04 13:21:11 +0400
committerAndrew Dolgov <fox@fakecake.org>2013-04-04 13:21:11 +0400
commite6cdbaec9fcc6a5245edbc3af358e64839646ff6 (patch)
treede68b42ab244e8098f8093331a1d5ccef638110c /js/viewfeed.js
parent5929a0c1e4a544718cd942afe27f9c832f87a2c0 (diff)
parent810205625b8afb7e08b2829723426f021e0a5c1b (diff)
Merge branch 'master' of github.com:gothfox/Tiny-Tiny-RSS
Diffstat (limited to 'js/viewfeed.js')
-rw-r--r--js/viewfeed.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index c1163eab7..7813ab7ef 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -12,6 +12,7 @@ var catchup_timeout_id = false;
var cids_requested = [];
var loaded_article_ids = [];
+var _last_headlines_update = 0;
var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
@@ -204,6 +205,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
}
_infscroll_request_sent = 0;
+ _last_headlines_update = new Date().getTime();
unpackVisibleHeadlines();
@@ -1159,7 +1161,6 @@ function postMouseOut(id) {
function unpackVisibleHeadlines() {
try {
-
if (!isCdmMode()) return;
$$("#headlines-frame > div[id*=RROW]").each(
@@ -1178,7 +1179,6 @@ function unpackVisibleHeadlines() {
}
);
-
} catch (e) {
exception_error("unpackVisibleHeadlines", e);
}
@@ -1209,6 +1209,10 @@ function headlines_scroll_handler(e) {
if (getInitParam("cdm_auto_catchup") == 1) {
+ // let's get DOM some time to settle down
+ var ts = new Date().getTime();
+ if (ts - _last_headlines_update < 100) return;
+
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
function(child) {
if (child.hasClassName("Unread") && $("headlines-frame").scrollTop >
@@ -1254,7 +1258,11 @@ function catchupBatchedArticles() {
onComplete: function(transport) {
handle_rpc_json(transport);
+ reply = JSON.parse(transport.responseText);
+ var batch = reply.ids;
+
batch.each(function(id) {
+ console.log(id);
var elem = $("RROW-" + id);
if (elem) elem.removeClassName("Unread");
catchup_id_batch.remove(id);