Skip to content
Snippets Groups Projects
Commit b14ba38f authored by Henrik Askjer's avatar Henrik Askjer
Browse files

refactor toggle

parent 7df9f32c
No related branches found
No related tags found
No related merge requests found
......@@ -70,17 +70,17 @@ export default {
computed: {
toggleSearchToolbar: {
get () { return this.$store.state.showSearchToolbar},
set () { this.$store.commit("toggleSearchToolbar")
set () { this.$store.commit("toggle", "showSearchToolbar")
}
},
toggleHGNO: {
get () { return this.$store.state.showHGNO},
set () { this.$store.commit("toggleHGNO")
set () { this.$store.commit("toggle", "showHGNO")
}
},
toggleInflectionNo: {
get () { return this.$store.state.showInflectionNo},
set () { this.$store.commit("toggleInflectionNo")
set () { this.$store.commit("toggle", "showInflectionNo")
}
},
......
......@@ -42,12 +42,12 @@ const store = new Vuex.Store({
},
changeLocale(state, locale) {
state.currentLocale = locale
localStorage.setItem("showSearchToolbar", locale);
localStorage.setItem("currentLocale", locale);
},
toggleSearchToolbar(state) {
let value = !state.showSearchToolbar
state.showSearchToolbar = value
localStorage.setItem("showSearchToolbar", value);
toggle(state, setting) {
let value = !state[setting]
state[setting] = value
localStorage.setItem(setting, value);
}
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment