Permalink
Browse files

jqmData: Check index of before running regex to improve performance F…

…ixes #5999 - $.find: added indexOf checking for jqmData selector to improve speed on non-jqm

selectors Thanks @tosyu
  • Loading branch information...
arschmitz committed Aug 6, 2013
1 parent 1bd14c1 commit 375b21ba03be1255ef13d80ef103a8bce157e959
Showing with 4 additions and 2 deletions.
  1. +3 −1 js/jquery.mobile.data.js
  2. +1 −1 js/widgets/forms/autogrow.js
View
@@ -106,7 +106,9 @@ define( [ "jquery", "./jquery.mobile.ns", "json!../package.json" ], function( jQ
$.find = function( selector, context, ret, extra ) {
selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
if ( selector.indexOf( ":jqmData" ) > -1 ) {
selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
}
return oldFind.call( this, selector, context, ret, extra );
};
@@ -66,7 +66,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
borderHeight = borderTop + borderBottom,
height = scrollHeight + borderHeight + 15;
this.element.css( "height", height + "px" );
this.element.css( "height", height + "px" );
},
_setOptions: function( options ){

0 comments on commit 375b21b

Please sign in to comment.