|
@@ -142,15 +142,25 @@ export default {
|
|
|
* @param {Event} event
|
|
|
*/
|
|
|
async addImage(event) {
|
|
|
- // console.log(event, event.target.files[0]);
|
|
|
- imageHandle.bind(this.$parent)(event);
|
|
|
+ if (!this.checkEditorFocus()) {
|
|
|
+ window.getSelection().removeAllRanges();
|
|
|
+ this.$el.nextSibling.focus();
|
|
|
+ } else {
|
|
|
+ // console.log(event, event.target.files[0]);
|
|
|
+ imageHandle.bind(this.$parent)(event);
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* @param {Event} event
|
|
|
*/
|
|
|
async addAnswerPoint(event) {
|
|
|
event.preventDefault();
|
|
|
- answerPointHandle.bind(this.$parent)(event);
|
|
|
+ if (!this.checkEditorFocus()) {
|
|
|
+ window.getSelection().removeAllRanges();
|
|
|
+ this.$el.nextSibling.focus();
|
|
|
+ } else {
|
|
|
+ answerPointHandle.bind(this.$parent)(event);
|
|
|
+ }
|
|
|
},
|
|
|
checkEditorFocus() {
|
|
|
const selection = window.getSelection();
|