]> git.wh0rd.org - tt-rss.git/commitdiff
FeedTree: fix subcategory entries not hidden properly
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 13 Sep 2012 22:40:01 +0000 (02:40 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 13 Sep 2012 22:40:01 +0000 (02:40 +0400)
js/FeedTree.js

index de1329bbe8e2f17e490075e413b95d2ba2414ec5..fb744bf9f9e9b77e9cc6239bc85248912460daaa 100644 (file)
@@ -245,13 +245,17 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
        hasCats: function() {
                return this.model.hasCats();
        },
-       hideRead: function (hide, show_special) {
+       hideReadCat: function (cat, hide, show_special) {
                if (this.hasCats()) {
-
                        var tree = this;
-                       var cats = this.model.store._arrayOfTopLevelItems;
 
-                       cats.each(function(cat) {
+                       if (cat && cat.items) {
+                               cat.items.each(function(child) {
+                                       if (child.items) {
+                                               tree.hideReadCat(child, hide, show_special);
+                                       }
+                               });
+
                                var cat_unread = tree.hideReadFeeds(cat.items, hide, show_special);
 
                                var id = String(cat.id);
@@ -270,6 +274,17 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
                                                ++cat_unread;
                                        }
                                }
+                       }
+               }
+       },
+       hideRead: function (hide, show_special) {
+               if (this.hasCats()) {
+
+                       var tree = this;
+                       var cats = this.model.store._arrayOfTopLevelItems;
+
+                       cats.each(function(cat) {
+                               tree.hideReadCat(cat, hide, show_special);
                        });
 
                } else {