Skip to content

Commit 36d7a6a

Browse files
committed
Don't request without any images
1 parent 469d4eb commit 36d7a6a

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
@@ -64,9 +64,7 @@
6464
plugin.find('.md-input-upload').on('change', function() {
6565
var files = $(this).get(0).files;
6666

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

7270
plugin.on('dragenter', function (e) {
@@ -222,6 +220,9 @@
222220
};
223221

224222
function uploadFiles (url, files, editor, snippetManager, loading) {
223+
if (!files.length) {
224+
return;
225+
}
225226

226227
loading.show();
227228

0 commit comments

Comments
 (0)