Skip to content

Commit 5b2bbd7

Browse files
committed
Allow preventing the default initialization for pages by canceling the pagebeforecreate event. Fixes jquery-archive#105.
1 parent 74a66af commit 5b2bbd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/jquery.mobile.page.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ $.widget( "mobile.page", $.mobile.widget, {
44
options: {},
55

66
_create: function() {
7-
this._trigger( "beforeCreate" );
7+
if ( this._trigger( "beforeCreate" ) === false ) {
8+
return;
9+
}
810

911
//some of the form elements currently rely on the presence of ui-page and ui-content
1012
// classes so we'll handle page and content roles outside of the main role processing

0 commit comments

Comments
 (0)