mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-09-24 16:40:55 -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
c9eb91eea4
commit
875cbd1b6a
@ -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) {
|
||||
self.uploadImages(event.target.files, onSuccess, onError);
|
||||
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