Skip to content

Commit 3092245

Browse files
committed
make sure control group runs after button creating widgets
1 parent 2aba18b commit 3092245

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

js/widgets/controlgroup.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,10 @@ define( [ "jquery",
101101
// correct order when their correct enhancement depends on other widgets in
102102
// the page being correctly enhanced already.
103103
//
104-
// For now, we wait until dom-ready to attach the controlgroup's enhancement
105-
// hook, because by that time, all the other widgets' enhancement hooks should
106-
// already be in place, ensuring that all widgets that need to be grouped will
107-
// already have been enhanced by the time the controlgroup is created.
108-
$( function() {
109-
$.mobile.document.bind( "pagecreate create", function( e ) {
110-
$.mobile.controlgroup.prototype.enhanceWithin( e.target, true );
111-
});
104+
// Dom ready was insufficient for preventing timing issues, use the page init
105+
// event to run this widget after all else. Widget registry incoming.
106+
$.mobile.document.bind( "pageinit create", function( e ) {
107+
$.mobile.controlgroup.prototype.enhanceWithin( e.target, true );
112108
});
113109
})(jQuery);
114110
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);

0 commit comments

Comments
 (0)