diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-07-09 15:24:34 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-07-09 15:24:34 +1000 |
| commit | cb6025a6e4990b5ed691106f26de01322f93063c (patch) | |
| tree | 5e28017dce4c680c04ac9f12654c1730dfad6a18 /src | |
| parent | f1f16687492102ccf8de3eaeda682c154518c321 (diff) | |
Make clicking 'Tilo' collapse the tree
Diffstat (limited to 'src')
| -rw-r--r-- | src/App.vue | 10 |
1 files changed, 9 insertions, 1 deletions
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}"> <!-- Title bar --> <div class="flex shadow gap-2 p-2" :style="{backgroundColor: uiOpts.bgColorDark2, color: uiOpts.altColor}"> - <h1 class="my-auto ml-2 text-4xl">Tilo</h1> + <h1 class="my-auto ml-2 text-4xl hover:cursor-pointer" @click="collapseTree">Tilo</h1> <div class="mx-auto"/> <!-- Spacer --> <!-- Icons --> <icon-button :disabled="isDisabled('help')" :size="45" :style="buttonStyles" @click="onHelpIconClick"> @@ -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)[]){ |
