Skip to content

Commit e9d9889

Browse files
author
Gabriel Schulhof
committed
page.sections: Use addEnhancementHook, but ignore non-"pagecreate" events.
1 parent 4e6301e commit e9d9889

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

js/widgets/page.sections.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//>>label: Page Sections
44
//>>group: Core
55

6-
define( [ "jquery", "./page", "../jquery.mobile.core" ], function( jQuery ) {
6+
define( [ "jquery", "./page", "../jquery.mobile.core", "../jquery.mobile.registry" ], function( jQuery ) {
77
//>>excludeEnd("jqmBuildExclude");
88
(function( $, undefined ) {
99

@@ -18,7 +18,12 @@ $.mobile.page.prototype.options.contentTheme = null;
1818
// which expects .ui-footer top be applied in its gigantic selector
1919
// TODO remove the buttonMarkup giant selector and move it to the various modules
2020
// on which it depends
21-
$.mobile.document.bind( "pagecreate", function( e ) {
21+
$.mobile.addEnhancementHook( "mobile-pageSections", {}, function( e ) {
22+
23+
if ( e.type !== "pagecreate" ) {
24+
return;
25+
}
26+
2227
var $page = $( e.target ),
2328
o = $page.data( "mobile-page" ).options,
2429
attrPrefix = "data-" + $.mobile.ns,

0 commit comments

Comments
 (0)