aboutsummaryrefslogtreecommitdiff
path: root/src/components/TileTree.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-03-22 16:21:28 +1100
committerTerry Truong <terry06890@gmail.com>2022-03-22 16:21:28 +1100
commitfb589b424a4e7b6ef3d19abf4be47b3ddfce5aca (patch)
treeebe13893fa2c494345382c7e47c233563b7c9ab9 /src/components/TileTree.vue
parent959c1661784a9a4d08c18762aedc69e405e57506 (diff)
Enable layouting with allowCollapse
Diffstat (limited to 'src/components/TileTree.vue')
-rw-r--r--src/components/TileTree.vue8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue
index c57821d..dc258d8 100644
--- a/src/components/TileTree.vue
+++ b/src/components/TileTree.vue
@@ -55,7 +55,7 @@ export default defineComponent({
// Update data and relayout tiles
this.width = document.documentElement.clientWidth - (this.otherOptions.rootOffset * 2);
this.height = document.documentElement.clientHeight - (this.otherOptions.rootOffset * 2);
- if (!this.layoutTree.tryLayout([0,0], [this.width,this.height])){
+ if (!this.layoutTree.tryLayout([0,0], [this.width,this.height], true)){
console.log('Unable to layout tree');
}
// Prevent re-triggering until after a delay
@@ -68,7 +68,7 @@ export default defineComponent({
//console.log('Tile to expand has no children');
return;
}
- let success = this.layoutTree.tryLayout([0,0], [this.width,this.height],
+ let success = this.layoutTree.tryLayout([0,0], [this.width,this.height], false,
{type: 'expand', node: layoutNode});
if (!success){
// Trigger failure animation
@@ -79,7 +79,7 @@ export default defineComponent({
}
},
onInnerHeaderClicked({layoutNode, domNode}: {layoutNode: LayoutNode, domNode: HTMLElement}){
- let success = this.layoutTree.tryLayout([0,0], [this.width,this.height],
+ let success = this.layoutTree.tryLayout([0,0], [this.width,this.height], false,
{type: 'collapse', node: layoutNode});
if (!success){
// Trigger failure animation
@@ -92,7 +92,7 @@ export default defineComponent({
},
created(){
window.addEventListener('resize', this.onResize);
- if (!this.layoutTree.tryLayout([0,0], [this.width,this.height])){
+ if (!this.layoutTree.tryLayout([0,0], [this.width,this.height], true)){
console.log('Unable to layout tree');
}
},