mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Moved the pagecreate handler registration for controlgroups to the init IIFE so it's executed after all required widgets have registered theirs
This commit is contained in:
parent
b0d261ebe0
commit
fe29c2adf7
2 changed files with 11 additions and 5 deletions
|
|
@ -47,11 +47,8 @@ $.fn.controlgroup = function( options ) {
|
|||
});
|
||||
};
|
||||
|
||||
//auto self-init widgets
|
||||
$( document ).bind( "pagecreate create", function( e ){
|
||||
$( ":jqmData(role='controlgroup')", e.target ).controlgroup({ excludeInvisible: false });
|
||||
});
|
||||
|
||||
// The pagecreate handler for controlgroup is in jquery.mobile.init because of the soft-dependency on the wrapped widgets
|
||||
|
||||
})(jQuery);
|
||||
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -154,6 +154,15 @@ define( [ "jquery", "jquery.mobile.core", "jquery.mobile.navigation", "jquery.mo
|
|||
// so if it's 1, use 0 from now on
|
||||
$.mobile.defaultHomeScroll = ( !$.support.scrollTop || $(window).scrollTop() === 1 ) ? 0 : 1;
|
||||
|
||||
|
||||
// TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
|
||||
//auto self-init widgets for those widgets that have a soft dependency on others
|
||||
if ( $.fn.controlgroup ) {
|
||||
$( document ).bind( "pagecreate create", function( e ){
|
||||
$( ":jqmData(role='controlgroup')", e.target ).controlgroup({ excludeInvisible: false });
|
||||
});
|
||||
}
|
||||
|
||||
//dom-ready inits
|
||||
if( $.mobile.autoInitializePage ){
|
||||
$.mobile.initializePage();
|
||||
|
|
|
|||
Loading…
Reference in a new issue