LP1823393 Tree component collapsed node display fix
authorBill Erickson <berickxx@gmail.com>
Thu, 24 Jan 2019 22:43:33 +0000 (17:43 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 5 Apr 2019 19:22:08 +0000 (15:22 -0400)
Avoid added child tree nodes when parent nodes are hidden.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/tree/tree.ts

index cca36d4..68e01fe 100644 (file)
@@ -73,9 +73,8 @@ export class Tree {
                 // Avoid adding hidden child nodes to the list.
             } else {
                 nodes.push(node);
+                node.children.forEach(n => recurseTree(n, depth, !node.expanded));
             }
-
-            node.children.forEach(n => recurseTree(n, depth, !node.expanded));
         };
 
         recurseTree(this.rootNode, 0, false);