mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-18 23:44:29 -06:00
Bail out if there are no files to upload.
Without this change, if you either: - Click and drag some text into the markdown editor, or - Copy paste some text into the markdown editor The status bar will get updated to say "Uploading image ...", and will never stop.
This commit is contained in:
parent
efb840c633
commit
8a2283cf27
@ -1669,6 +1669,9 @@ function EasyMDE(options) {
|
||||
* @param [onError] {function} see EasyMDE.prototype.uploadImage
|
||||
*/
|
||||
EasyMDE.prototype.uploadImages = function (files, onSuccess, onError) {
|
||||
if (files.length === 0) {
|
||||
return;
|
||||
}
|
||||
var names = [];
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
names.push(files[i].name);
|
||||
@ -1688,6 +1691,9 @@ EasyMDE.prototype.uploadImages = function (files, onSuccess, onError) {
|
||||
* @param {FileList} files The files to upload the the server.
|
||||
*/
|
||||
EasyMDE.prototype.uploadImagesUsingCustomFunction = function (imageUploadFunction, files) {
|
||||
if (files.length === 0) {
|
||||
return;
|
||||
}
|
||||
var names = [];
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
names.push(files[i].name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user