LP1823393 Tree component collapsed node display fix
authorBill Erickson <berickxx@gmail.com>
Thu, 24 Jan 2019 22:43:33 +0000 (17:43 -0500)
committerJane Sandberg <sandbej@linnbenton.edu>
Fri, 24 May 2019 17:55:53 +0000 (10:55 -0700)
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>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
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);