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

WIP collapse articles

parent c72c7b00
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,11 @@
label="Vis bøyningsnumre"
hide-details
></v-checkbox>
<v-checkbox
v-model="toggleCollapse"
label="Kollaps artikler"
hide-details
></v-checkbox>
</v-list>
</template>
......@@ -38,6 +43,11 @@ export default {
get () { return this.$store.state.showInflectionNo},
set () { this.$store.commit("toggle", "showInflectionNo")
}
},
toggleCollapse: {
get () { return this.$store.state.collapseArticles},
set () { this.$store.commit("toggle", "collapseArticles")
}
}
},
}
......
......@@ -26,7 +26,8 @@ const store = new Vuex.Store({
showSearchToolbar: null,
showHGNO: null,
showInflectionNo: null,
currentLocale: null
currentLocale: null,
collapseArticles: null
},
mutations: {
initStore(state) {
......@@ -36,6 +37,8 @@ const store = new Vuex.Store({
state.currentLocale = localStorage.getItem('currentLocale')
state.defaultDict = localStorage.getItem('defaultDict') || 'bm,nn'
state.collapseArticles = localStorage.getItem('collapseArticles') || window.innerWidth < 700
let locales = navigator.languages.map(l => l.split("-")[0])
if (!state.currentLocale) {
if (locales.includes("nn")) state.currentLocale = "nno"
......@@ -62,6 +65,7 @@ const store = new Vuex.Store({
localStorage.removeItem("showHGNO")
localStorage.removeItem("showInflectionNo")
localStorage.removeItem("currentLocale")
localStorage.removeItem("collapseArticles")
this.commit("initStore")
},
......
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