]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix 'x' hotkey, add FeedTree.collapseCat
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 27 Dec 2010 12:39:40 +0000 (15:39 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 27 Dec 2010 12:39:40 +0000 (15:39 +0300)
FeedTree.js
tt-rss.js

index f2e82d13d0be0b1e2b397a88e2e7fe40b594284b..d1caeba706ed06ee360e9703c07ebf46e46b719d 100644 (file)
@@ -134,7 +134,7 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
                        tnode._menu = menu;
                }
 
-               //tnode.labelNode.innerHTML = args.label;
+               tnode.labelNode.innerHTML = args.label;
                return tnode;
        },
        getIconClass: function (item, opened) {
@@ -251,6 +251,25 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
        
                return cat_unread;
        },
+       collapseCat: function(id) {
+               if (!this.model.hasCats()) return;
+
+               var tree = this;
+
+               var node = tree._itemNodesMap['CAT:' + id][0];
+               var item = tree.model.store._itemsByIdentity['CAT:' + id];
+
+               if (node && item) {
+                       var hidden = tree.model.store.getValue(item, 'hidden');
+
+                       if (hidden) 
+                               tree._expandNode(node);
+                       else
+                               tree._collapseNode(node);
+
+                       tree.model.store.setValue(item, 'hidden', !hidden);
+               }
+       },
        collapseHiddenCats: function() {
                if (!this.model.hasCats()) return;
 
index d619c4c028f2ecf2d678b9f2ddadfcec38b9058a..546c221319e1352e08d24c821745eb9fec05fc2a 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -808,7 +808,7 @@ function hotkey_handler(e) {
 
                        if (keycode == 88) { // x
                                if (activeFeedIsCat()) {
-                                       toggleCollapseCat(getActiveFeedId());
+                                       dijit.byId("feedTree").collapseCat(getActiveFeedId());
                                }
                        }
                }