Skip to content

Instantly share code, notes, and snippets.

@arschmitz
Created April 1, 2015 14:23
Show Gist options
  • Select an option

  • Save arschmitz/73ab7a50d20952485ba2 to your computer and use it in GitHub Desktop.

Select an option

Save arschmitz/73ab7a50d20952485ba2 to your computer and use it in GitHub Desktop.
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
//>>description: The mobile namespace on the jQuery object
//>>label: Namespace
//>>group: Core
define([ "jquery" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");
(function( $ ) {
$.mobile = {};
if ( !$.fn.enhance ) {
$.fn.enhance = $.noop;
}
$.fn.enhance.initGenerator = function( widgetName, initSelector ) {
var first = true,
fullSelector = "",
primarySelector = "[data-" + $.mobile.ns + "role='" + widgetName + "']";
if ( initSelector ) {
$.each( initSelector.split( "," ), function( index, selector ) {
fullSelector += ( !first ? ", " : "" ) + selector + ":not( [data-" + $.mobile.ns +
"role='none'], [data-enhance='false'] " + selector +" )";
first = false;
});
return fullSelector;
}
return primarySelector + ":not( [data-" + $.mobile.ns + "role='none'], [data-" +
$.mobile.ns + "enhance='false'] " + primarySelector + " )";
};
}( jQuery ));
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment