mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-20 12:21:52 +00:00
Make sure that the :jqdata() selector also works for filtered items.
This commit is contained in:
parent
018609fa32
commit
29c0471cca
1 changed files with 10 additions and 2 deletions
|
|
@ -151,11 +151,19 @@
|
|||
// Monkey-patching Sizzle to filter the :jqdata selector
|
||||
var oldFind = jQuery.find;
|
||||
|
||||
jQuery.find = function( selector, context, ret ) {
|
||||
jQuery.find = function( selector, context, ret, extra ) {
|
||||
selector = selector.replace(/:jqdata\(([^)]*)\)/g, "[data-" + (jQuery.mobile.ns || "") + "$1]");
|
||||
|
||||
return oldFind.call( this, selector, context, ret );
|
||||
return oldFind.call( this, selector, context, ret, extra );
|
||||
};
|
||||
|
||||
jQuery.extend( jQuery.find, oldFind );
|
||||
|
||||
jQuery.find.matches = function( expr, set ) {
|
||||
return jQuery.find( expr, null, null, set );
|
||||
};
|
||||
|
||||
jQuery.find.matchesSelector = function( node, expr ) {
|
||||
return jQuery.find( expr, null, null, [node] ).length > 0;
|
||||
};
|
||||
})( jQuery, this );
|
||||
|
|
|
|||
Loading…
Reference in a new issue