wikijs-fork/client/js/components/editor-image.js

24 lines
522 B
JavaScript
Raw Normal View History

2016-09-17 04:26:02 +00:00
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();
}
}
});