From ef4a9b9223d6019f0b782eb2f944f3cfe2b6ed41 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Fri, 8 Jul 2022 00:24:47 +1000 Subject: Adjust SCollapsible, allowing for v-model and @open --- src/App.vue | 64 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src/App.vue') diff --git a/src/App.vue b/src/App.vue index 1c4b74b..8e3bd11 100644 --- a/src/App.vue +++ b/src/App.vue @@ -251,38 +251,6 @@ export default defineComponent({ return styles; }, }, - watch: { - infoModalNodeName(newVal, oldVal){ - // Possibly trigger tutorial advance - if (newVal == null){ - this.handleActionForTutorial('tileInfo'); - } - }, - modeRunning(newVal, oldVal){ - // For sweepToParent setting 'fallback', temporarily change to 'prefer' for efficiency - if (newVal != null){ - if (this.lytOpts.sweepToParent == 'fallback'){ - this.lytOpts.sweepToParent = 'prefer'; - this.changedSweepToParent = true; - } - } else { - if (this.changedSweepToParent){ - this.lytOpts.sweepToParent = 'fallback'; - this.changedSweepToParent = false; - } - } - // Possibly trigger tutorial advance - if (newVal == null){ - this.handleActionForTutorial(oldVal); - } - }, - settingsOpen(newVal, oldVal){ - // Possibly trigger tutorial advance - if (newVal == false){ - this.handleActionForTutorial('settings'); - } - }, - }, methods: { // For tile expand/collapse events async onLeafClick(layoutNode: LayoutNode, subAction = false): Promise { @@ -1033,6 +1001,38 @@ export default defineComponent({ return actions.some(a => disabledActions.has(a)); }, }, + watch: { + infoModalNodeName(newVal, oldVal){ + // Possibly trigger tutorial advance + if (newVal == null){ + this.handleActionForTutorial('tileInfo'); + } + }, + modeRunning(newVal, oldVal){ + // For sweepToParent setting 'fallback', temporarily change to 'prefer' for efficiency + if (newVal != null){ + if (this.lytOpts.sweepToParent == 'fallback'){ + this.lytOpts.sweepToParent = 'prefer'; + this.changedSweepToParent = true; + } + } else { + if (this.changedSweepToParent){ + this.lytOpts.sweepToParent = 'fallback'; + this.changedSweepToParent = false; + } + } + // Possibly trigger tutorial advance + if (newVal == null){ + this.handleActionForTutorial(oldVal); + } + }, + settingsOpen(newVal, oldVal){ + // Possibly trigger tutorial advance + if (newVal == false){ + this.handleActionForTutorial('settings'); + } + }, + }, created(){ window.addEventListener('resize', this.onResize); window.addEventListener('keydown', this.onKeyUp); -- cgit v1.2.3