diff options
author | Andrew Dolgov <[email protected]> | 2018-12-09 13:52:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-09 13:52:21 +0300 |
commit | dc84e10ba1c0a886bf56d63b7d6d145806d2cc71 (patch) | |
tree | c73ff8a70f0a347b27ef9a26c8db88d506918aef /js/Feeds.js | |
parent | fa538a6c86bad425a361cd9bc06b15dbad13bd50 (diff) |
catchupFeedInGroup: overhaul
1. less hacky way to catchup actually unread headlines
2. don't fade rows away because it's inconsistent with different mark-as-read functions
3. fix stuck progress alert
Diffstat (limited to 'js/Feeds.js')
-rw-r--r-- | js/Feeds.js | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/js/Feeds.js b/js/Feeds.js index 52c1476f7..76a6f5971 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -480,40 +480,17 @@ define(["dojo/_base/declare"], function (declare) { if (App.getInitParam("confirm_feed_catchup") != 1 || confirm(str)) { - const rows = $$("#headlines-frame > div[id*=RROW][data-orig-feed-id='" + id + "']"); + const rows = $$("#headlines-frame > div[id*=RROW][class*=Unread][data-orig-feed-id='" + id + "']"); if (rows.length > 0) { - rows.each(function (row) { - row.removeClassName("Unread"); - - if (row.getAttribute("data-article-id") != Article.getActive()) { - new Effect.Fade(row, {duration: 0.5}); - } + for (let i = 0; i < rows.length; i++) + Headlines.catchup_id_batch.push(rows[i].getAttribute("data-article-id")); + Headlines.catchupBatched(() => { + Headlines.updateFloatingTitle(true); }); - - const feedTitles = $$("#headlines-frame > div[class='feed-title']"); - - for (let i = 0; i < feedTitles.length; i++) { - if (feedTitles[i].getAttribute("data-feed-id") == id) { - - if (i < feedTitles.length - 1) { - new Effect.Fade(feedTitles[i], {duration: 0.5}); - } - - break; - } - } - - Headlines.updateFloatingTitle(true); } - - Notify.progress("Loading, please wait...", true); - - xhrPost("backend.php", {op: "rpc", method: "catchupFeed", feed_id: id, is_cat: false}, (transport) => { - App.handleRpcJson(transport); - }); } }, getUnread: function(feed, is_cat) { |