diff options
Diffstat (limited to 'js/viewfeed.js')
| -rw-r--r-- | js/viewfeed.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js index dc8d3fe88..b708accfd 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -590,7 +590,7 @@ function moveToPost(mode, noscroll, noexpand) { if (!getInitParam("cdm_expanded")) { - if (!noscroll && article.offsetTop < ctr.scrollTop) { + if (!noscroll && article && article.offsetTop < ctr.scrollTop) { scrollArticle(-ctr.offsetHeight/4); } else { cdmExpandArticle(prev_id, noexpand); @@ -1240,6 +1240,29 @@ function headlines_scroll_handler(e) { unpackVisibleHeadlines(); + // set topmost child in the buffer as active + if (getInitParam("cdm_auto_catchup") == 1) { + var rows = $$("#headlines-frame > div[id*=RROW]"); + + for (var i = 0; i < rows.length; i++) { + var child = rows[i]; + + if ($("headlines-frame").scrollTop < child.offsetTop && + child.offsetTop - $("headlines-frame").scrollTop < 100) { + + if (_active_article_id) { + var row = $("RROW-" + _active_article_id); + if (row) row.removeClassName("active"); + } + + _active_article_id = child.id.replace("RROW-", ""); + showArticleInHeadlines(_active_article_id, true); + updateSelectedPrompt(); + break; + } + } + } + if (!_infscroll_disable) { if ((hsp && e.scrollTop + e.offsetHeight >= hsp.offsetTop - hsp.offsetHeight) || (e.scrollHeight != 0 && @@ -1275,6 +1298,7 @@ function headlines_scroll_handler(e) { //console.log("auto_catchup_batch: " + catchup_id_batch.toString()); } + }); if (catchup_id_batch.length > 0) { @@ -1897,7 +1921,7 @@ function initHeadlinesMenu() { }})); menu.addChild(new dijit.MenuItem({ - label: __("Toggle marked"), + label: __("Toggle starred"), onClick: function(event) { var ids = getSelectedArticleIds2(); // cast to string |