Skip to content

Commit 5700edc

Browse files
committed
Move the autoUpload option into the basic plugin.
1 parent 0ac42c5 commit 5700edc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/jquery.fileupload.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.21.4
2+
* jQuery File Upload Plugin 5.22
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -112,6 +112,8 @@
112112
progressInterval: 100,
113113
// Interval in milliseconds to calculate progress bitrate:
114114
bitrateInterval: 500,
115+
// By default, uploads are started automatically when adding files:
116+
autoUpload: true,
115117

116118
// Additional form data to be sent along with the file uploads can be set
117119
// using this option, which accepts an array of objects with name and
@@ -136,7 +138,11 @@
136138
// handlers using jQuery's Deferred callbacks:
137139
// data.submit().done(func).fail(func).always(func);
138140
add: function (e, data) {
139-
data.submit();
141+
if (data.autoUpload || (data.autoUpload !== false &&
142+
($(this).data('blueimp-fileupload') ||
143+
$(this).data('fileupload')).options.autoUpload)) {
144+
data.submit();
145+
}
140146
},
141147

142148
// Other callbacks:

0 commit comments

Comments
 (0)