File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
app/assets/javascripts/jquery-fileupload Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 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
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 ( / ^ d a t a - / . 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 }
You can’t perform that action at this time.
0 commit comments