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:08:02 -04:00
parent 8cac1c5777
commit 42c1271963

View file

@ -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);