Skip to content

Commit f2ee627

Browse files
committed
update jQuery File Upload Plugin from 5.32.3 to 5.32.6
1 parent b5f9974 commit f2ee627

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.32.3
2+
* jQuery File Upload Plugin 5.32.6
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -534,8 +534,10 @@
534534
options.url = options.form.prop('action') || location.href;
535535
}
536536
// 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();
539541
if (options.type !== 'POST' && options.type !== 'PUT' &&
540542
options.type !== 'PATCH') {
541543
options.type = 'POST';
@@ -1118,9 +1120,8 @@
11181120
data.files.push(file);
11191121
}
11201122
});
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);
11241125
}
11251126
}
11261127
},
@@ -1143,13 +1144,15 @@
11431144

11441145
_onDragOver: function (e) {
11451146
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) {
11531156
e.preventDefault();
11541157
}
11551158
}

0 commit comments

Comments
 (0)