Skip to content

Commit 43673fe

Browse files
author
scottjehl
committed
Fixed a regression with initializing pages that have no data-role=page container. Too aggressive on an earlier deletion.
1 parent c5f0eb3 commit 43673fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/jquery.mobile.init.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
9494
initializePage: function() {
9595
// find present pages
9696
var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" );
97-
97+
98+
// if no pages are found, create one with body's inner html
99+
if ( !$pages.length ) {
100+
$pages = $( "body" ).wrapInner( "<div data-" + $.mobile.ns + "role='page'></div>" ).children( 0 );
101+
}
102+
98103
// add dialogs, set data-url attrs
99104
$pages.each(function() {
100105
var $this = $(this);

0 commit comments

Comments
 (0)