|
@@ -316,13 +316,20 @@ $(document).ready(function() {
|
|
|
})
|
|
|
}
|
|
|
expandByCustom(fun) {
|
|
|
- this.expandCache = [];
|
|
|
+ const self = this;
|
|
|
+ const expandCache = [];
|
|
|
+ const expandChildren = function(children) {
|
|
|
+ for (const child of children) {
|
|
|
+ if (!child.children || child.children.length === 0) continue;
|
|
|
+ const expand = fun(child);
|
|
|
+ if (expand) expandCache.push(child.id);
|
|
|
+ self.filingTree.expandNode(child, expand, false, false);
|
|
|
+ expandChildren(child.children);
|
|
|
+ }
|
|
|
+ };
|
|
|
const nodes = this.filingTree.getNodes();
|
|
|
- for (const node of nodes) {
|
|
|
- const expand = fun(node);
|
|
|
- if (expand) this.expandCache.push(node.id);
|
|
|
- this.filingTree.expandNode(node, expand, false, false);
|
|
|
- }
|
|
|
+ expandChildren(nodes);
|
|
|
+ this.expandCache = expandCache;
|
|
|
setLocalCache(this.expandKey, this.expandCache.join(','));
|
|
|
}
|
|
|
moveFiling(node, tree_pid, tree_order) {
|