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
This commit is contained in:
parent
fa538a6c86
commit
dc84e10ba1
33
js/Feeds.js
33
js/Feeds.js
|
@ -480,40 +480,17 @@ define(["dojo/_base/declare"], function (declare) {
|
||||||
|
|
||||||
if (App.getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
|
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) {
|
if (rows.length > 0) {
|
||||||
|
|
||||||
rows.each(function (row) {
|
for (let i = 0; i < rows.length; i++)
|
||||||
row.removeClassName("Unread");
|
Headlines.catchup_id_batch.push(rows[i].getAttribute("data-article-id"));
|
||||||
|
|
||||||
if (row.getAttribute("data-article-id") != Article.getActive()) {
|
|
||||||
new Effect.Fade(row, {duration: 0.5});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
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) {
|
getUnread: function(feed, is_cat) {
|
||||||
|
|
|
@ -255,7 +255,7 @@ define(["dojo/_base/declare"], function (declare) {
|
||||||
let vgrhdr = `<div data-feed-id='${hl.feed_id}' class='feed-title'>
|
let vgrhdr = `<div data-feed-id='${hl.feed_id}' class='feed-title'>
|
||||||
<div style='float : right'>${hl.feed_icon}</div>
|
<div style='float : right'>${hl.feed_icon}</div>
|
||||||
<a class="title" href="#" onclick="Feeds.open({feed:${hl.feed_id}})">${hl.feed_title}
|
<a class="title" href="#" onclick="Feeds.open({feed:${hl.feed_id}})">${hl.feed_title}
|
||||||
<a class="catchup" onclick="Feeds.catchupFeedInGroup(${hl.feed_id})" href="#">${__('mark feed as read')}</a>
|
<a class="catchup" title="${__('mark feed as read')}" onclick="Feeds.catchupFeedInGroup(${hl.feed_id})" href="#"><i class="material-icons">check_circle</i></a>
|
||||||
</div>`
|
</div>`
|
||||||
|
|
||||||
const tmp = document.createElement("div");
|
const tmp = document.createElement("div");
|
||||||
|
|
Loading…
Reference in New Issue