Skip to content

Commit 699da32

Browse files
committed
Feature
Hide lock menu when it's already locked
1 parent 48d5b73 commit 699da32

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

virtdata-docsys/src/main/node/docsys/components/DocsMenu.vue

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<!-- Use active_category and active_topic to select inactive -->
88

99
<v-list dense>
10-
<v-list-item>
10+
<v-list-item
11+
v-if="$vuetify.breakpoint.mdAndDown">
1112
<v-list-item-action>
1213
<v-switch flat inset v-model="lockmenu" @change="setLockMenu"></v-switch>
1314
</v-list-item-action>
@@ -21,7 +22,7 @@
2122

2223
<template v-slot:activator>
2324
<v-list-item-content>
24-
<!-- <router-link :to="{ name: 'docs-slug', params: {lockmenu:lockmenu}}">-->
25+
<!-- <router-link :to="{ name: 'docs-slug', params: {lockmenu:lockmenu}}"> -->
2526
<router-link :to="{path: category.category+'.html'}">
2627
<v-list-item-title>
2728
{{category.categoryName}}
@@ -31,7 +32,7 @@
3132
</template>
3233

3334
<v-list-item v-for="(doc, i) in category.docs" :key="i" link :to="doc.filename">
34-
<!-- <router-link :to="{ name: 'docs-slug', params: {lockmenu:lockmenu}}">-->
35+
<!-- <router-link :to="{ name: 'docs-slug', params: {lockmenu:lockmenu}}"> -->
3536
<router-link :to="{ path: doc.filename + '.html'}">
3637
<v-list-item-title>{{doc.attributes.title}}</v-list-item-title>
3738
</router-link>
@@ -52,10 +53,14 @@
5253
active_topic: String
5354
},
5455
data(context) {
56+
let lockmenu = this.$store.state.docs.isMenuLocked;
57+
if (lockmenu == null){
58+
lockmenu = false
59+
}
5560
console.log("data says context is: " + context);
5661
// console.log("g says" + this.$getters.docs.drawerState);
5762
return {
58-
lockmenu: false,
63+
lockmenu: lockmenu,
5964
drawer: null
6065
}
6166
},
@@ -73,16 +78,10 @@
7378
console.log("mutation type " + mutation.type);
7479
if (mutation.type === 'docs/toggleDrawerState') {
7580
this.drawer=this.$store.state.docs.isDrawerOpen;
76-
} else if (mutation.type === 'docs/toggleDrawerLock') {
77-
this.lockmenu=this.$store.state.docs.isDrawerLocked;
81+
} else if (mutation.type === 'docs/setMenuLock') {
82+
this.lockmenu=this.$store.state.docs.isMenuLocked;
7883
}
7984
});
8085
},
81-
// computed: {
82-
// drawerState() {
83-
// console.log("getting drawerState...");
84-
// return this.$store.getters.drawerState;
85-
// }
86-
// },
8786
}
8887
</script>

0 commit comments

Comments
 (0)