Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ export function p_urlParse() {
return obj;
};

export function stopEvent(e) {
if (!e) {
return;
}
if (e.preventDefault) {
e.preventDefault();
}
if (e.stopPropagation) {
e.stopPropagation();
}
};

5 changes: 4 additions & 1 deletion src/mavon-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
loadScript,
ImagePreviewListener
} from './lib/core/extra-function.js'
import {p_ObjectCopy_DEEP} from './lib/util.js'
import {p_ObjectCopy_DEEP, stopEvent} from './lib/util.js'
import {toolbar_left_click, toolbar_left_addlink} from './lib/toolbar_left_click.js'
import {toolbar_right_click} from './lib/toolbar_right_click.js'
import {CONFIG} from './lib/config.js'
Expand Down Expand Up @@ -347,6 +347,9 @@
}
}
if (item && item.kind === 'file') {
// prevent filename being pasted parallel along
// with the image pasting process
stopEvent($e)
var oFile = item.getAsFile();
this.$refs.toolbar_left.$imgFilesAdd([oFile,]);
}
Expand Down