LP1823393 Tree component collapsed node display fix
authorBill Erickson <berickxx@gmail.com>
Thu, 24 Jan 2019 22:43:33 +0000 (17:43 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 23 May 2019 15:49:14 +0000 (11:49 -0400)
Avoid added child tree nodes when parent nodes are hidden.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
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);