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 { ...@@ -70,17 +70,17 @@ export default {
computed: { computed: {
toggleSearchToolbar: { toggleSearchToolbar: {
get () { return this.$store.state.showSearchToolbar}, get () { return this.$store.state.showSearchToolbar},
set () { this.$store.commit("toggleSearchToolbar") set () { this.$store.commit("toggle", "showSearchToolbar")
} }
}, },
toggleHGNO: { toggleHGNO: {
get () { return this.$store.state.showHGNO}, get () { return this.$store.state.showHGNO},
set () { this.$store.commit("toggleHGNO") set () { this.$store.commit("toggle", "showHGNO")
} }
}, },
toggleInflectionNo: { toggleInflectionNo: {
get () { return this.$store.state.showInflectionNo}, 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({ ...@@ -42,12 +42,12 @@ const store = new Vuex.Store({
}, },
changeLocale(state, locale) { changeLocale(state, locale) {
state.currentLocale = locale state.currentLocale = locale
localStorage.setItem("showSearchToolbar", locale); localStorage.setItem("currentLocale", locale);
}, },
toggleSearchToolbar(state) { toggle(state, setting) {
let value = !state.showSearchToolbar let value = !state[setting]
state.showSearchToolbar = value state[setting] = value
localStorage.setItem("showSearchToolbar", 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