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

Commit 375b21b

Browse files
committed
jqmData: Check index of before running regex to improve performance Fixes #5999 - $.find: added indexOf checking for jqmData selector to improve speed on non-jqm
selectors Thanks @tosyu
1 parent 1bd14c1 commit 375b21b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

js/jquery.mobile.data.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ define( [ "jquery", "./jquery.mobile.ns", "json!../package.json" ], function( jQ
106106

107107

108108
$.find = function( selector, context, ret, extra ) {
109-
selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
109+
if ( selector.indexOf( ":jqmData" ) > -1 ) {
110+
selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
111+
}
110112

111113
return oldFind.call( this, selector, context, ret, extra );
112114
};

js/widgets/forms/autogrow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
6666
borderHeight = borderTop + borderBottom,
6767
height = scrollHeight + borderHeight + 15;
6868

69-
this.element.css( "height", height + "px" );
69+
this.element.css( "height", height + "px" );
7070
},
7171

7272
_setOptions: function( options ){

0 commit comments

Comments
 (0)