Skip to content

Commit d17c4ad

Browse files
committed
Don't request without any images
1 parent 01cb7e5 commit d17c4ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/bootstrap-markdown-editor.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
plugin.find('.md-input-upload').on('change', function() {
6666
var files = $(this).get(0).files;
6767

68-
if (files.length) {
69-
uploadFiles(defaults.uploadPath, $(this).get(0).files, editor, snippetManager, mdLoading);
70-
}
68+
uploadFiles(defaults.uploadPath, $(this).get(0).files, editor, snippetManager, mdLoading);
7169
});
7270

7371
plugin.on('dragenter', function (e) {
@@ -223,6 +221,9 @@
223221
};
224222

225223
function uploadFiles (url, files, editor, snippetManager, loading) {
224+
if (!files.length) {
225+
return;
226+
}
226227

227228
loading.show();
228229

0 commit comments

Comments
 (0)