From 66af65f14b4f3c670bb3f9ca7b1c80081f9281d1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Apr 2013 15:22:05 +0400 Subject: [PATCH] initial --- js/FeedTree.js | 17 +++++++++++++---- tt-rss.css | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/js/FeedTree.js b/js/FeedTree.js index bb50d6fb..f874db70 100644 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -184,6 +184,11 @@ dojo.declare("fox.FeedTree", dijit.Tree, { tnode._menu = menu; } + ctr = dojo.doc.createElement('span'); + ctr.className = 'counterNode'; + ctr.innerHTML = '0'; + dojo.place(ctr, tnode.labelNode, 'after'); + tnode.counterNode = ctr; //tnode.labelNode.innerHTML = args.label; return tnode; @@ -195,8 +200,12 @@ dojo.declare("fox.FeedTree", dijit.Tree, { return (item.unread == 0) ? "dijitTreeLabel" : "dijitTreeLabel Unread"; }, getRowClass: function (item, opened) { - return (!item.error || item.error == '') ? "dijitTreeRow" : + var rc = (!item.error || item.error == '') ? "dijitTreeRow" : "dijitTreeRow Error"; + + if (item.unread > 0) rc += " Unread"; + + return rc; }, getLabel: function(item) { var name = String(item.name); @@ -208,15 +217,15 @@ dojo.declare("fox.FeedTree", dijit.Tree, { name = name.replace(/</g, "<"); name = name.replace(/>/g, ">"); - var label; + /* var label; if (item.unread > 0) { label = name + " (" + item.unread + ")"; } else { label = name; - } + } */ - return label; + return name; }, expandParentNodes: function(feed, is_cat, list) { try { diff --git a/tt-rss.css b/tt-rss.css index 48a5aa59..c328822f 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1012,3 +1012,22 @@ div.hl.active a.title { color : #4684ff; } +#feedTree .dijitTreeRow span.counterNode { + display : none; +} + +#feedTree .dijitTreeRow.Unread span.counterNode { + display : inline; +} + +#feedTree span.counterNode:before { + content: "("; +} + +#feedTree span.counterNode:after { + content: ")"; +} + +#feedTree span.counterNode { + font-weight : bold; +} -- 2.39.5