var cids_requested = [];
var loaded_article_ids = [];
+var _last_headlines_update = 0;
var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
vgroup_last_feed = reply['headlines-info']['vgroup_last_feed'];
- if (parseInt(headlines_count) < getInitParam("default_article_limit")) {
+ if (parseInt(headlines_count) < 30) {
_infscroll_disable = 1;
} else {
_infscroll_disable = 0;
}
_infscroll_request_sent = 0;
+ _last_headlines_update = new Date().getTime();
unpackVisibleHeadlines();
function unpackVisibleHeadlines() {
try {
-
if (!isCdmMode()) return;
$$("#headlines-frame > div[id*=RROW]").each(
}
);
-
} catch (e) {
exception_error("unpackVisibleHeadlines", 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 >
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);