mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-18 23:44:29 -06:00
Fix openBrowseFileWindow
to also obey self.options.imageUploadFunction
if specified.
I think this part just got missed in https://github.com/Ionaru/easy-markdown-editor/pull/106. I'm not sure if I should be doing anything with the `onSuccess` and `onError` callbacks here.
This commit is contained in:
parent
02d6653cc5
commit
efb840c633
@ -1985,7 +1985,11 @@ EasyMDE.prototype.openBrowseFileWindow = function (onSuccess, onError) {
|
||||
var imageInput = this.gui.toolbar.getElementsByClassName('imageInput')[0];
|
||||
imageInput.click(); //dispatchEvent(new MouseEvent('click')); // replaced with click() for IE11 compatibility.
|
||||
function onChange(event) {
|
||||
if (self.options.imageUploadFunction) {
|
||||
self.uploadImagesUsingCustomFunction(self.options.imageUploadFunction, event.target.files);
|
||||
} else {
|
||||
self.uploadImages(event.target.files, onSuccess, onError);
|
||||
}
|
||||
imageInput.removeEventListener('change', onChange);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user