2017-10-30 01:36:05 +00:00
|
|
|
/* global wikijs */
|
2017-06-05 03:16:00 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
namespaced: true,
|
|
|
|
state: {
|
2017-06-08 02:16:43 +00:00
|
|
|
shown: false,
|
|
|
|
mode: 'image'
|
2017-06-05 03:16:00 +00:00
|
|
|
},
|
|
|
|
getters: {},
|
|
|
|
mutations: {
|
2017-06-08 02:16:43 +00:00
|
|
|
shownChange: (state, shownState) => { state.shown = shownState },
|
|
|
|
modeChange: (state, modeState) => { state.mode = modeState }
|
2017-06-05 03:16:00 +00:00
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
open({ commit }, opts) {
|
|
|
|
commit('shownChange', true)
|
2017-06-08 02:16:43 +00:00
|
|
|
commit('modeChange', opts.mode)
|
2017-06-05 03:16:00 +00:00
|
|
|
wikijs.$emit('editorFile/init')
|
|
|
|
},
|
|
|
|
close({ commit }) { commit('shownChange', false) }
|
|
|
|
}
|
|
|
|
}
|