diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-06-20 00:39:21 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-06-20 01:04:36 +1000 |
| commit | 44d25c8beb0d00f72a837fcf34c891f1473671f0 (patch) | |
| tree | f55cffc40057f9e0cd901fcae0ac3d0ca29c97e3 | |
| parent | 365682e56c28884bb1bd9d71e56f600c512f7db3 (diff) | |
Avoid creating certain redundant dom-nodes after layout-with-collapse
| -rw-r--r-- | src/App.vue | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/App.vue b/src/App.vue index 9b39759..3d9b340 100644 --- a/src/App.vue +++ b/src/App.vue @@ -300,17 +300,20 @@ export default defineComponent({ this.activeRoot = layoutNode; this.updateAreaDims().then(() => this.relayoutWithCollapse()); }, - onDetachedAncestorClick(layoutNode: LayoutNode, skipRelayout = false){ + onDetachedAncestorClick(layoutNode: LayoutNode, alsoCollapse = false){ if (!this.handleActionForTutorial('unhideAncestor')){ return; } this.setLastFocused(null); - LayoutNode.showDownward(layoutNode); this.activeRoot = layoutNode; this.overflownRoot = false; - if (!skipRelayout){ - this.updateAreaDims().then(() => this.relayoutWithCollapse()); + if (alsoCollapse){ + this.onNonleafClick(layoutNode, true); } + return this.updateAreaDims().then(() => { + this.relayoutWithCollapse(); + LayoutNode.showDownward(layoutNode); + }); }, // For tile-info events onInfoIconClick(nodeName: string){ @@ -374,9 +377,8 @@ export default defineComponent({ this.onDetachedAncestorClick(nodeInAncestryBar!); setTimeout(() => this.expandToNode(name), this.uiOpts.tileChgDuration); } else{ - this.onDetachedAncestorClick(nodeInAncestryBar, true); - this.onNonleafClick(nodeInAncestryBar, true); - this.expandToNode(name); + this.onDetachedAncestorClick(nodeInAncestryBar, true) + .then(() => this.expandToNode(name)); } return; } |
