wikijs-fork/client/js/components/editor-image.js
2016-09-17 00:26:06 -04:00

24 lines
522 B
JavaScript

let vueImage = new Vue({
el: '#modal-editor-image',
data: {
modeSelected: 'text'
},
methods: {
cancel: (ev) => {
mdeModalOpenState = false;
$('#modal-editor-image').slideUp();
},
insertImage: (ev) => {
if(mde.codemirror.doc.somethingSelected()) {
mde.codemirror.execCommand('singleSelection');
}
let codeBlockText = '\n```' + vueCodeBlock.modeSelected + '\n' + codeEditor.getValue() + '\n```\n';
mde.codemirror.doc.replaceSelection(codeBlockText);
vueCodeBlock.cancel();
}
}
});