Skip to content

Commit b1b0b04

Browse files
committed
Respect the autoUpload setting and process only when submitting.
1 parent 0cd06c2 commit b1b0b04

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/jquery.fileupload-fp.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload File Processing Plugin 1.2.1
2+
* jQuery File Upload File Processing Plugin 1.2.3
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2012, Sebastian Tschan
@@ -62,9 +62,13 @@
6262
// fileupload widget (via file input selection, drag & drop or add
6363
// API call). See the basic file upload widget for more information:
6464
add: function (e, data) {
65-
$(this).fileupload('process', data).done(function () {
66-
data.submit();
67-
});
65+
if (data.autoUpload || (data.autoUpload !== false &&
66+
($(this).data('blueimp-fileupload') ||
67+
$(this).data('fileupload')).options.autoUpload)) {
68+
$(this).fileupload('process', data).done(function () {
69+
data.submit();
70+
});
71+
}
6872
}
6973
},
7074

0 commit comments

Comments
 (0)