Skip to content

Commit

Permalink
Fixed broken data attributes handling for IE<9.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed Feb 5, 2015
1 parent bae3f31 commit 37513c8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion blueimp-file-upload.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload",
"version": "9.9.2",
"version": "9.9.3",
"title": "jQuery File Upload",
"author": {
"name": "Sebastian Tschan",
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload",
"version": "9.9.2",
"version": "9.9.3",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.",
"keywords": [
Expand Down
23 changes: 12 additions & 11 deletions js/jquery.fileupload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery File Upload Plugin 5.42.2
* jQuery File Upload Plugin 5.42.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -1344,18 +1344,19 @@
_initDataAttributes: function () {
var that = this,
options = this.options,
clone = $(this.element[0].cloneNode(false)),
data = clone.data();
// Avoid memory leaks:
clone.remove();
data = this.element.data();
// Initialize options set via HTML5 data-attributes:
$.each(
data,
function (key, value) {
var dataAttributeName = 'data-' +
// Convert camelCase to hyphen-ated key:
key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
if (clone.attr(dataAttributeName)) {
this.element[0].attributes,
function (index, attr) {
var key = attr.name.toLowerCase(),
value;
if (/^data-/.test(key)) {
// Convert hyphen-ated key to camelCase:
key = key.slice(5).replace(/-[a-z]/g, function (str) {
return str.charAt(1).toUpperCase();
});
value = data[key];
if (that._isRegExpOption(key, value)) {
value = that._getRegExp(value);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload",
"version": "9.9.2",
"version": "9.9.3",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.",
"keywords": [
Expand Down

0 comments on commit 37513c8

Please sign in to comment.