This commit is contained in:
Andrew Dolgov 2013-04-10 15:22:05 +04:00
parent c3b06333b6
commit 66af65f14b
2 changed files with 32 additions and 4 deletions

View File

@ -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(/&lt;/g, "<");
name = name.replace(/&gt;/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 {

View File

@ -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;
}