Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit bf2d956

Browse files
johnbenderjaspermdegroot
authored andcommitted
correct jqmData behavior to match our tests
1 parent da764d4 commit bf2d956

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/jquery.mobile.core.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,14 @@ define( [ "jquery", "../external/requirejs/text!../version.txt", "./jquery.mobil
260260
if ( prop ) {
261261
prop = $.mobile.nsNormalize( prop );
262262
}
263-
result = this.data.apply( this, arguments.length < 2 ? [ prop ] : [ prop, value ] );
263+
264+
// undefined is permitted as an explicit input for the second param
265+
// in this case it returns the value and does not set it to undefined
266+
if( arguments.length < 2 || value === undefined ){
267+
result = this.data( prop );
268+
} else {
269+
result = this.data( prop, value );
270+
}
264271
}
265272
return result;
266273
};

0 commit comments

Comments
 (0)