1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:25:59 +00:00

implement additional counter mode for virtual feeds when there's 0 unread articles

This commit is contained in:
Andrew Dolgov
2013-05-16 01:08:04 +04:00
parent 96ce71f35f
commit c594eca0de
5 changed files with 33 additions and 5 deletions

View File

@@ -186,11 +186,13 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
ctr = dojo.doc.createElement('span');
ctr.className = 'counterNode';
ctr.innerHTML = args.item.unread;
ctr.innerHTML = args.item.unread > 0 ? args.item.unread : args.item.auxcounter;
//args.item.unread > 0 ? ctr.addClassName("unread") : ctr.removeClassName("unread");
args.item.unread > 0 ? Element.show(ctr) : Element.hide(ctr);
args.item.unread > 0 || args.item.auxcounter > 0 ? Element.show(ctr) : Element.hide(ctr);
args.item.unread == 0 && args.item.auxcounter > 0 ? ctr.addClassName("aux") : ctr.removeClassName("aux");
dojo.place(ctr, tnode.rowNode, 'first');
tnode.counterNode = ctr;
@@ -218,10 +220,14 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
if (node.counterNode) {
ctr = node.counterNode;
ctr.innerHTML = item.unread;
item.unread > 0 ? Effect.Appear(ctr, {duration : 0.3,
ctr.innerHTML = item.unread > 0 ? item.unread : item.auxcounter;
item.unread > 0 || item.auxcounter > 0 ?
Effect.Appear(ctr, {duration : 0.3,
queue: { position: 'end', scope: 'CAPPEAR-' + item.id, limit: 1 }}) :
Element.hide(ctr);
item.unread == 0 && item.auxcounter > 0 ? ctr.addClassName("aux") : ctr.removeClassName("aux");
}
}

View File

@@ -219,6 +219,7 @@ function parse_counters(elems, scheduled_call) {
var error = elems[l].error;
var has_img = elems[l].has_img;
var updated = elems[l].updated;
var auxctr = parseInt(elems[l].auxcounter);
if (id == "global-unread") {
global_unread = ctr;
@@ -236,6 +237,7 @@ function parse_counters(elems, scheduled_call) {
}
setFeedUnread(id, (kind == "cat"), ctr);
setFeedValue(id, (kind == "cat"), 'auxcounter', auxctr);
if (kind != "cat") {
setFeedValue(id, false, 'error', error);