|
1 | 1 | /*
|
2 |
| - * jQuery File Upload Plugin 5.32.3 |
| 2 | + * jQuery File Upload Plugin 5.32.6 |
3 | 3 | * https://github.com/blueimp/jQuery-File-Upload
|
4 | 4 | *
|
5 | 5 | * Copyright 2010, Sebastian Tschan
|
|
534 | 534 | options.url = options.form.prop('action') || location.href;
|
535 | 535 | }
|
536 | 536 | // The HTTP request method must be "POST" or "PUT":
|
537 |
| - options.type = (options.type || options.form.prop('method') || '') |
538 |
| - .toUpperCase(); |
| 537 | + options.type = (options.type || |
| 538 | + ($.type(options.form.prop('method')) === 'string' && |
| 539 | + options.form.prop('method')) || '' |
| 540 | + ).toUpperCase(); |
539 | 541 | if (options.type !== 'POST' && options.type !== 'PUT' &&
|
540 | 542 | options.type !== 'PATCH') {
|
541 | 543 | options.type = 'POST';
|
|
1118 | 1120 | data.files.push(file);
|
1119 | 1121 | }
|
1120 | 1122 | });
|
1121 |
| - if (this._trigger('paste', e, data) === false || |
1122 |
| - this._onAdd(e, data) === false) { |
1123 |
| - return false; |
| 1123 | + if (this._trigger('paste', e, data) !== false) { |
| 1124 | + this._onAdd(e, data); |
1124 | 1125 | }
|
1125 | 1126 | }
|
1126 | 1127 | },
|
|
1143 | 1144 |
|
1144 | 1145 | _onDragOver: function (e) {
|
1145 | 1146 | e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
|
1146 |
| - var dataTransfer = e.dataTransfer; |
1147 |
| - if (dataTransfer) { |
1148 |
| - if (this._trigger('dragover', e) === false) { |
1149 |
| - return false; |
1150 |
| - } |
1151 |
| - if ($.inArray('Files', dataTransfer.types) !== -1) { |
1152 |
| - dataTransfer.dropEffect = 'copy'; |
| 1147 | + var dataTransfer = e.dataTransfer, |
| 1148 | + data = { |
| 1149 | + dropEffect: 'copy', |
| 1150 | + preventDefault: true |
| 1151 | + }; |
| 1152 | + if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 && |
| 1153 | + this._trigger('dragover', e, data) !== false) { |
| 1154 | + dataTransfer.dropEffect = data.dropEffect; |
| 1155 | + if (data.preventDefault) { |
1153 | 1156 | e.preventDefault();
|
1154 | 1157 | }
|
1155 | 1158 | }
|
|
0 commit comments