aboutsummaryrefslogtreecommitdiff
path: root/src/lib.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.ts')
-rw-r--r--src/lib.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib.ts b/src/lib.ts
index b98576d..ed46ea5 100644
--- a/src/lib.ts
+++ b/src/lib.ts
@@ -106,7 +106,7 @@ export class LayoutNode {
node = node.parent;
}
}
- //
+ // Used to hide/show parent nodes upon expand-to-view
static hideUpward(node: LayoutNode){
if (node.parent != null){
node.parent.hidden = true;
@@ -116,9 +116,13 @@ export class LayoutNode {
}
static hideDownward(node: LayoutNode){
node.hidden = true;
- node.children.forEach(n => {
- LayoutNode.hideDownward(n)
- });
+ node.children.forEach(n => LayoutNode.hideDownward(n));
+ }
+ static showDownward(node: LayoutNode){
+ if (node.hidden){
+ node.hidden = false;
+ node.children.forEach(n => LayoutNode.showDownward(n));
+ }
}
}
// Contains settings that affect how layout is done