1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 19:55:55 +00:00

enable server-side storage of collapsed status of categories

This commit is contained in:
Andrew Dolgov
2010-11-20 11:52:11 +03:00
parent 692de15991
commit 1a709d21d5
2 changed files with 23 additions and 2 deletions

View File

@@ -237,4 +237,22 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
return cat_unread;
},
collapseHiddenCats: function() {
if (!this.model.hasCats()) return;
var cats = this.model.store._arrayOfTopLevelItems;
var tree = this;
dojo.forEach(cats, function(cat) {
var hidden = tree.model.store.getValue(cat, 'hidden');
var id = tree.model.store.getValue(cat, 'id');
var node = tree._itemNodesMap[id][0];
if (hidden)
tree._collapseNode(node);
else
tree._expandNode(node);
});
},
});