2017-05-22 17:32:52 +00:00
|
|
|
export default {
|
2017-06-10 14:41:15 +00:00
|
|
|
namespaced: true,
|
2017-05-22 17:32:52 +00:00
|
|
|
state: {
|
|
|
|
shown: false,
|
|
|
|
hash: ''
|
|
|
|
},
|
|
|
|
getters: {},
|
|
|
|
mutations: {
|
|
|
|
anchorChange: (state, opts) => {
|
|
|
|
state.shown = (opts.shown === true)
|
|
|
|
state.hash = opts.hash || ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
actions: {
|
2017-06-10 14:41:15 +00:00
|
|
|
open({ commit }, hash) {
|
2017-05-22 17:32:52 +00:00
|
|
|
commit('anchorChange', { shown: true, hash })
|
|
|
|
},
|
2017-06-10 14:41:15 +00:00
|
|
|
close({ commit }) {
|
2017-05-22 17:32:52 +00:00
|
|
|
commit('anchorChange', { shown: false })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|