2017-05-28 02:24:46 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
namespaced: true,
|
|
|
|
state: {
|
2017-05-28 18:34:50 +00:00
|
|
|
shown: false,
|
|
|
|
content: ''
|
2017-05-28 02:24:46 +00:00
|
|
|
},
|
|
|
|
getters: {},
|
|
|
|
mutations: {
|
2017-05-28 18:34:50 +00:00
|
|
|
shownChange: (state, shownState) => { state.shown = shownState },
|
|
|
|
contentChange: (state, newContent) => { state.content = newContent }
|
2017-05-28 02:24:46 +00:00
|
|
|
},
|
|
|
|
actions: {
|
2017-05-28 18:34:50 +00:00
|
|
|
open({ commit }, opts) {
|
|
|
|
commit('shownChange', true)
|
|
|
|
commit('contentChange', opts.initialContent || '')
|
|
|
|
wikijs.$emit('editorCodeblock/init')
|
|
|
|
},
|
2017-05-28 02:24:46 +00:00
|
|
|
close({ commit }) { commit('shownChange', false) }
|
|
|
|
}
|
|
|
|
}
|