From cb6025a6e4990b5ed691106f26de01322f93063c Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sat, 9 Jul 2022 15:24:34 +1000 Subject: Make clicking 'Tilo' collapse the tree --- src/App.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/App.vue b/src/App.vue index 6dc5440..dc9b167 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,7 +3,7 @@ :style="{backgroundColor: uiOpts.bgColor}">
-

Tilo

+

Tilo

@@ -922,6 +922,14 @@ export default defineComponent({ await this.onNonleafClick(this.layoutTree, true); await this.initTreeFromServer(false); }, + async collapseTree(){ + if (this.activeRoot != this.layoutTree){ + await this.onDetachedAncestorClick(this.layoutTree, true); + } + if (this.layoutTree.children.length > 0){ + await this.onNonleafClick(this.layoutTree); + } + }, getLytOpts(): LayoutOptions { let opts = getDefaultLytOpts(); for (let prop of Object.getOwnPropertyNames(opts) as (keyof LayoutOptions)[]){ -- cgit v1.2.3