|
1 | 1 | /*
|
2 |
| - * jQuery File Upload Plugin 5.42.2 |
| 2 | + * jQuery File Upload Plugin 5.42.3 |
3 | 3 | * https://github.com/blueimp/jQuery-File-Upload
|
4 | 4 | *
|
5 | 5 | * Copyright 2010, Sebastian Tschan
|
|
277 | 277 | // The following are jQuery ajax settings required for the file uploads:
|
278 | 278 | processData: false,
|
279 | 279 | contentType: false,
|
280 |
| - cache: false |
| 280 | + cache: false, |
| 281 | + timeout: 0 |
281 | 282 | },
|
282 | 283 |
|
283 | 284 | // A list of options that require reinitializing event listeners and/or
|
|
983 | 984 | fileSet,
|
984 | 985 | i,
|
985 | 986 | j = 0;
|
986 |
| - if (limitSize && (!filesLength || files[0].size === undefined)) { |
| 987 | + if (!filesLength) { |
| 988 | + return false; |
| 989 | + } |
| 990 | + if (limitSize && files[0].size === undefined) { |
987 | 991 | limitSize = undefined;
|
988 | 992 | }
|
989 | 993 | if (!(options.singleFileUploads || limit || limitSize) ||
|
|
1344 | 1348 | _initDataAttributes: function () {
|
1345 | 1349 | var that = this,
|
1346 | 1350 | options = this.options,
|
1347 |
| - clone = $(this.element[0].cloneNode(false)), |
1348 |
| - data = clone.data(); |
1349 |
| - // Avoid memory leaks: |
1350 |
| - clone.remove(); |
| 1351 | + data = this.element.data(); |
1351 | 1352 | // Initialize options set via HTML5 data-attributes:
|
1352 | 1353 | $.each(
|
1353 |
| - data, |
1354 |
| - function (key, value) { |
1355 |
| - var dataAttributeName = 'data-' + |
1356 |
| - // Convert camelCase to hyphen-ated key: |
1357 |
| - key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); |
1358 |
| - if (clone.attr(dataAttributeName)) { |
| 1354 | + this.element[0].attributes, |
| 1355 | + function (index, attr) { |
| 1356 | + var key = attr.name.toLowerCase(), |
| 1357 | + value; |
| 1358 | + if (/^data-/.test(key)) { |
| 1359 | + // Convert hyphen-ated key to camelCase: |
| 1360 | + key = key.slice(5).replace(/-[a-z]/g, function (str) { |
| 1361 | + return str.charAt(1).toUpperCase(); |
| 1362 | + }); |
| 1363 | + value = data[key]; |
1359 | 1364 | if (that._isRegExpOption(key, value)) {
|
1360 | 1365 | value = that._getRegExp(value);
|
1361 | 1366 | }
|
|
0 commit comments