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

Commit 2e48c7b

Browse files
author
Gabriel Schulhof
committed
Widget: Use new $.mobile.getAttribute function instead of jqmData for a 70% perf improvement.
http://jsperf.com/data-ignore/2
1 parent 8113b4a commit 2e48c7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/jquery.mobile.widget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ $.widget( "mobile.widget", {
2626

2727
$.each( this.options, function( option ) {
2828

29-
var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) {
29+
var value = $.mobile.getAttribute( elem[ 0 ], "data-" + $.mobile.ns + ( option.replace( /[A-Z]/g, function( c ) {
3030
return "-" + c.toLowerCase();
31-
})
31+
}))
3232
);
3333

3434
if ( value !== undefined ) {

0 commit comments

Comments
 (0)