mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-05 21:24:45 +00:00
Adding in a new :jqdata() selector for filtering data- attributes within the proper jQuery Mobile namespace.
This commit is contained in:
parent
8cac1c5777
commit
42c1271963
1 changed files with 11 additions and 0 deletions
|
|
@ -236,6 +236,17 @@
|
|||
}
|
||||
});
|
||||
|
||||
// Monkey-patching Sizzle to filter the :jqdata selector
|
||||
var oldFind = jQuery.find;
|
||||
|
||||
jQuery.find = function( selector, context, ret ) {
|
||||
selector = selector.replace(/:jqdata\((.*)\)/g, "[data-" + (jQuery.mobile.ns || "") + "$1]");
|
||||
|
||||
return oldFind.call( this, selector, context, ret );
|
||||
};
|
||||
|
||||
jQuery.extend( jQuery.find, oldFind );
|
||||
|
||||
//dom-ready inits
|
||||
$($.mobile.initializePage);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue