diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-10 23:45:46 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-10 23:45:46 +1100 |
| commit | e2df6e256dd017760747bd0c982e7b2a489b0794 (patch) | |
| tree | 0aaa2becdce1bb4c6e2b5b5d4698032dc71f258c /src/components | |
| parent | e635f8c72f5b2e7bd132993ce01fc9b1965e3207 (diff) | |
Fix a few layout bugs
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/TileTree.vue | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue index 1c7d593..debf77a 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -47,7 +47,7 @@ export default { if (!this.resizeThrottled){ this.width = document.documentElement.clientWidth; this.height = document.documentElement.clientHeight; - this.tryLayout(); //use best-effort collapsing-layout? + this.tryLayout(); //prevent re-triggering until after a delay this.resizeThrottled = true; setTimeout(() => {this.resizeThrottled = false;}, 100); @@ -71,9 +71,11 @@ export default { nodeList[0].children = []; }, onInnerHeaderClicked(nodeList){ //nodeList is array of tree-objects, from clicked-on-tile's tree-object upward + let children = nodeList[0].children; nodeList[0].children = []; layoutInfoHooks.updateLayoutInfoOnCollapse(nodeList); - this.tryLayout(); + if (!this.tryLayout()) + nodeList[0].children = children; }, tryLayout(){ let layout = LAYOUT_FUNC(this.tree, 0, 0, this.width, this.height, true); |
