summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-05-16 01:08:04 +0400
committerAndrew Dolgov <[email protected]>2013-05-16 01:08:04 +0400
commitc594eca0de78f46bd5f18194c058d94487d1a9e2 (patch)
tree1a1394b9ceea84dcdc2e6c7b027453d6fda91907 /js
parent96ce71f35f2dd5bd08e140ffbe47e8fe40ec0c01 (diff)
implement additional counter mode for virtual feeds when there's 0 unread articles
Diffstat (limited to 'js')
-rw-r--r--js/FeedTree.js14
-rw-r--r--js/feedlist.js2
2 files changed, 12 insertions, 4 deletions
diff --git a/js/FeedTree.js b/js/FeedTree.js
index f3ac8ba19..e35417daf 100644
--- a/js/FeedTree.js
+++ b/js/FeedTree.js
@@ -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");
+
}
}
diff --git a/js/feedlist.js b/js/feedlist.js
index 51082f827..84b561227 100644
--- a/js/feedlist.js
+++ b/js/feedlist.js
@@ -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);