refactor: editor codeblock -> Vue component

This commit is contained in:
NGPixel
2017-05-28 14:34:50 -04:00
parent ebe288a5b2
commit f577a8134e
14 changed files with 295 additions and 303 deletions

View File

@@ -3,14 +3,20 @@
export default {
namespaced: true,
state: {
shown: false
shown: false,
content: ''
},
getters: {},
mutations: {
shownChange: (state, shownState) => { state.shown = shownState }
shownChange: (state, shownState) => { state.shown = shownState },
contentChange: (state, newContent) => { state.content = newContent }
},
actions: {
open({ commit }) { commit('shownChange', true) },
open({ commit }, opts) {
commit('shownChange', true)
commit('contentChange', opts.initialContent || '')
wikijs.$emit('editorCodeblock/init')
},
close({ commit }) { commit('shownChange', false) }
}
}