Skip to content

Commit f929ac2

Browse files
committed
Merge pull request blueimp#2169 from teynon/master
Deleting files misleading - Files removed before ajax request is processed
2 parents 8b46603 + 5717811 commit f929ac2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

js/jquery.fileupload-ui.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,16 @@
328328
var that = $(this).data('blueimp-fileupload') ||
329329
$(this).data('fileupload');
330330
if (data.url) {
331-
$.ajax(data);
331+
$.ajax(data).done(function() {
332+
that._transition(data.context).done(
333+
function () {
334+
$(this).remove();
335+
that._trigger('destroyed', e, data);
336+
}
337+
);
338+
});
332339
that._adjustMaxNumberOfFiles(1);
333340
}
334-
that._transition(data.context).done(
335-
function () {
336-
$(this).remove();
337-
that._trigger('destroyed', e, data);
338-
}
339-
);
340341
}
341342
},
342343

0 commit comments

Comments
 (0)