Skip to content

Commit f4eaca3

Browse files
committed
Update assets to v9.9.3
Fixed broken data attributes handling for IE<9.
1 parent 7205a74 commit f4eaca3

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.42.2
2+
* jQuery File Upload Plugin 5.42.3
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -1344,18 +1344,19 @@
13441344
_initDataAttributes: function () {
13451345
var that = this,
13461346
options = this.options,
1347-
clone = $(this.element[0].cloneNode(false)),
1348-
data = clone.data();
1349-
// Avoid memory leaks:
1350-
clone.remove();
1347+
data = this.element.data();
13511348
// Initialize options set via HTML5 data-attributes:
13521349
$.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)) {
1350+
this.element[0].attributes,
1351+
function (index, attr) {
1352+
var key = attr.name.toLowerCase(),
1353+
value;
1354+
if (/^data-/.test(key)) {
1355+
// Convert hyphen-ated key to camelCase:
1356+
key = key.slice(5).replace(/-[a-z]/g, function (str) {
1357+
return str.charAt(1).toUpperCase();
1358+
});
1359+
value = data[key];
13591360
if (that._isRegExpOption(key, value)) {
13601361
value = that._getRegExp(value);
13611362
}

0 commit comments

Comments
 (0)