aboutsummaryrefslogtreecommitdiff
path: root/src/layout.ts
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-20 00:32:37 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-20 00:32:37 +1000
commit365682e56c28884bb1bd9d71e56f600c512f7db3 (patch)
tree95e46affd27687eba45cda39913b0a2417c3c576 /src/layout.ts
parent7a4b5e0c84df9bb69c32f85890309ca4f5522576 (diff)
Avoid adding dom-nodes for hidden-ancestor other-children
Diffstat (limited to 'src/layout.ts')
-rw-r--r--src/layout.ts4
1 files changed, 4 insertions, 0 deletions
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));
}
}