|
@@ -121,11 +121,14 @@ export default {
|
|
|
setDocMode(type) {
|
|
|
setDocMode(type, this.$parent.$refs.editor);
|
|
|
},
|
|
|
+ editorFocus() {
|
|
|
+ this.$parent.$el.querySelector(".v-editor-body").focus();
|
|
|
+ },
|
|
|
execCommand(command, event) {
|
|
|
event.preventDefault();
|
|
|
if (!this.checkEditorFocus()) {
|
|
|
window.getSelection().removeAllRanges();
|
|
|
- this.$el.nextSibling.focus();
|
|
|
+ this.editorFocus();
|
|
|
} else {
|
|
|
document.execCommand(command);
|
|
|
}
|
|
@@ -145,7 +148,7 @@ export default {
|
|
|
event.preventDefault();
|
|
|
if (!this.checkEditorFocus()) {
|
|
|
window.getSelection().removeAllRanges();
|
|
|
- this.$el.nextSibling.focus();
|
|
|
+ this.editorFocus();
|
|
|
} else {
|
|
|
// console.log(event, event.target.files[0]);
|
|
|
this.$refs.ImageInput.click();
|
|
@@ -162,7 +165,7 @@ export default {
|
|
|
event.preventDefault();
|
|
|
if (!this.checkEditorFocus()) {
|
|
|
window.getSelection().removeAllRanges();
|
|
|
- this.$el.nextSibling.focus();
|
|
|
+ this.editorFocus();
|
|
|
} else {
|
|
|
answerPointHandle.bind(this.$parent)(event);
|
|
|
}
|
|
@@ -178,7 +181,7 @@ export default {
|
|
|
event.preventDefault();
|
|
|
if (!this.checkEditorFocus()) {
|
|
|
window.getSelection().removeAllRanges();
|
|
|
- this.$el.nextSibling.focus();
|
|
|
+ this.editorFocus();
|
|
|
}
|
|
|
this.curEditFocusRange = window.getSelection().getRangeAt(0);
|
|
|
this.$refs.FormulaDialog.open();
|