Adding in a new :jqdata() selector for filtering data- attributes within the proper jQuery Mobile namespace.

This commit is contained in:
John Resig 2011-03-15 15:00:20 -04:00
parent 83e7aeb4a5
commit da24d27796

View file

@ -109,4 +109,15 @@
}, 150 );
}
});
// 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 );
})( jQuery, this );