aboutsummaryrefslogtreecommitdiff
path: root/src/lib.ts
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-03-28 01:15:53 +1100
committerTerry Truong <terry06890@gmail.com>2022-03-28 01:22:25 +1100
commitb82d3a24b2487454397535c6fefda250d4ff6114 (patch)
tree87d2f0e4aa7984fc57eff66fb98f4a2d6738ea05 /src/lib.ts
parent567b5b605bf57f305197621d0ddc5f2b8c23ed64 (diff)
Enable auto-mode to trigger expand/collapse-fail animations
Done by sending a signal to a failed-operation's LayoutNode's Tile component via a watched property on LayoutNode. Also added code to prevent auto-mode from retrying a failed expand/collapse. Not an ideal solution, but signalling via LayoutNode is more general, and arguably cleaner, than the previous method of triggering fail animations by getting Tile to pass a callback upward as event data.
Diffstat (limited to 'src/lib.ts')
-rw-r--r--src/lib.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib.ts b/src/lib.ts
index 450eb90..a82bbd9 100644
--- a/src/lib.ts
+++ b/src/lib.ts
@@ -30,6 +30,8 @@ export class LayoutNode {
sepSweptArea: SepSweptArea | null;
hidden: boolean;
hasFocus: boolean;
+ collapseFailFlag: boolean; // Used to trigger failure animations
+ expandFailFlag: boolean; // Used to trigger failure animations
// Used for layout heuristics and info display
dCount: number; // Number of descendant leaf nodes
depth: number; // Number of ancestor nodes
@@ -45,6 +47,8 @@ export class LayoutNode {
this.sepSweptArea = null;
this.hidden = false;
this.hasFocus = false;
+ this.collapseFailFlag = false;
+ this.expandFailFlag = false;
this.dCount = children.length == 0 ? 1 : arraySum(children.map(n => n.dCount));
this.depth = 0;
this.empSpc = 0;