diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-21 17:49:16 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-21 17:49:16 +1100 |
| commit | ab97a285a700743169c56aecb1ba3e8d05f32fbb (patch) | |
| tree | 6722dffcacdbeaa083a1f8729949306cb58a6759 /src/components/TileTree.vue | |
| parent | a5c9ce0d755b9aa6183ea5df519920b1086da07c (diff) | |
Avoid changing DOM-bound tree before new layout is determined
Also made layout functions modify the passed-in tree instead of
generating a new tree. And added type LayoutTreeChg.
Diffstat (limited to 'src/components/TileTree.vue')
| -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 c277556..bdc3959 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -68,7 +68,8 @@ export default defineComponent({ //console.log('Tile to expand has no children'); return; } - let success = this.layoutTree.tryLayoutOnExpand([0,0], [this.width,this.height], layoutNode); + let success = this.layoutTree.tryLayout([0,0], [this.width,this.height], + {type: 'expand', node: layoutNode}); if (!success){ // Trigger failure animation domNode.classList.remove('animate-expand-shrink'); @@ -78,7 +79,8 @@ export default defineComponent({ } }, onInnerHeaderClicked({layoutNode, domNode}: {layoutNode: LayoutNode, domNode: HTMLElement}){ - let success = this.layoutTree.tryLayoutOnCollapse([0,0], [this.width,this.height], layoutNode); + let success = this.layoutTree.tryLayout([0,0], [this.width,this.height], + {type: 'collapse', node: layoutNode}); if (!success){ // Trigger failure animation domNode.classList.remove('animate-shrink-expand'); |
