aboutsummaryrefslogtreecommitdiff
path: root/src/components/TutorialPane.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-24 15:30:37 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-24 15:30:37 +1000
commite034e2ea9e74cf6f01ea4f978a3fb61e019c7d4b (patch)
tree17bc16f040d5643046181bfdf6ada09c7519ed1b /src/components/TutorialPane.vue
parente3247212baaaee292d5710d9e062c64b64f14edc (diff)
Hide buttons and info-icons during parts of tutorial
Diffstat (limited to 'src/components/TutorialPane.vue')
-rw-r--r--src/components/TutorialPane.vue33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/components/TutorialPane.vue b/src/components/TutorialPane.vue
index d34456d..5e6c1c0 100644
--- a/src/components/TutorialPane.vue
+++ b/src/components/TutorialPane.vue
@@ -47,37 +47,46 @@ export default defineComponent({
methods: {
onStartTutorial(){
this.stage = 1;
- this.sendEnabledFeatures();
+ this.setEnabledFeatures();
},
onPrevClick(){
this.stage = Math.max(1, this.stage - 1);
- this.sendEnabledFeatures();
+ this.setEnabledFeatures();
},
onNextClick(){
this.stage = Math.min(this.maxStage, this.stage + 1);
- this.sendEnabledFeatures();
+ this.setEnabledFeatures();
},
onClose(){
this.$emit('close');
},
- sendEnabledFeatures(){
+ setEnabledFeatures(){
const stageActions = [
null,
'expand', 'expand', 'collapse', 'expandToView', 'unhideAncestor',
- 'tileInfo', 'search', 'autoMode', 'settings', 'help'
+ 'tileInfo', 'search', 'autoMode', 'settings', 'help',
] as (Action | null)[];
- let disabledActions = new Set() as Set<Action>;
- for (let i = this.stage + 1; i < this.maxStage; i++){
- disabledActions.add(stageActions[i] as Action);
+ let disabledActions = this.uiOpts.disabledActions;
+ let currentAction = stageActions[this.stage];
+ for (let i = 1; i <= this.maxStage; i++){
+ let action = stageActions[i];
+ if (i <= this.stage){
+ if (disabledActions.has(action)){
+ disabledActions.delete(action);
+ }
+ } else {
+ if (!disabledActions.has(action) && action != currentAction){
+ disabledActions.add(action);
+ }
+ }
}
- disabledActions.delete(stageActions[this.stage] as Action);
- let triggerAction = stageActions[this.stage] as Action;
- this.$emit('stage-chg', disabledActions, triggerAction);
+ let triggerAction = currentAction;
+ this.$emit('stage-chg', triggerAction);
},
},
created(){
if (this.skipWelcome){
- this.sendEnabledFeatures();
+ this.setEnabledFeatures();
}
},
components: {CloseIcon, RButton, },