From 365682e56c28884bb1bd9d71e56f600c512f7db3 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Mon, 20 Jun 2022 00:32:37 +1000 Subject: Avoid adding dom-nodes for hidden-ancestor other-children --- src/layout.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/layout.ts') diff --git a/src/layout.ts b/src/layout.ts index 71fb476..0dd598d 100644 --- a/src/layout.ts +++ b/src/layout.ts @@ -26,6 +26,7 @@ export class LayoutNode { empSpc: number; // Amount of unused layout space (in pixels) // Other hidden: boolean; // Used to hide nodes upon an expand-to-view + hiddenWithVisibleChild: boolean; hasFocus: boolean; // Used by search and auto-mode to highlight a tile failFlag: boolean; // Used to trigger failure animations // Constructor ('parent' are 'depth' are generally initialised later, 'dCount' is computed) @@ -43,6 +44,7 @@ export class LayoutNode { this.empSpc = 0; // this.hidden = false; + this.hiddenWithVisibleChild = false; this.hasFocus = false; this.failFlag = false; } @@ -144,6 +146,7 @@ export class LayoutNode { static hideUpward(node: LayoutNode, map: LayoutMap): void { if (node.parent != null){ node.parent.hidden = true; + node.parent.hiddenWithVisibleChild = true; node.parent.children.filter(child => child != node).forEach(sibling => { sibling.hidden = true; // Remove sibling children from layout tree @@ -158,6 +161,7 @@ export class LayoutNode { static showDownward(node: LayoutNode): void { if (node.hidden){ node.hidden = false; + node.hiddenWithVisibleChild = false; node.children.forEach(n => LayoutNode.showDownward(n)); } } -- cgit v1.2.3