]> git.wh0rd.org Git - tt-rss.git/commitdiff
initial
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 10 Apr 2013 11:22:05 +0000 (15:22 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 10 Apr 2013 11:22:05 +0000 (15:22 +0400)
js/FeedTree.js
tt-rss.css

index bb50d6fbb5b44af08941bc8d3820056a51665b8c..f874db702c17bb8d4d0ac913a15ed3c3b8220040 100644 (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 {
index 48a5aa5964700ff5e74d438121081eaf3b91f533..c328822f57a6dd43827053d4f4a3eb0d15f48d9c 100644 (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;
+}