Skip to content

Commit

Permalink
feat: ✨ image extension support httpRequest options
Browse files Browse the repository at this point in the history
  • Loading branch information
Leecason committed Dec 18, 2019
1 parent dc1ba38 commit fe236c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/src/components/MenuCommands/ImageUploadCommandButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export default {
},
methods: {
uploadImage (uploadOptions) {
async uploadImage (uploadOptions) {
const { file } = uploadOptions;
readFileDataUrl(file)
.then((url) => {
this.editorContext.commands.image({ src: url });
const httpRequest = this.editorContext.editor.extensions.options.image.httpRequest;
const url = await (httpRequest ? httpRequest(file) : readFileDataUrl(file));
this.imageUploadDialogVisible = false;
});
this.editorContext.commands.image({ src: url });
this.imageUploadDialogVisible = false;
},
},
};
Expand Down

0 comments on commit fe236c5

Please sign in to comment.