1 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
2 //>>description: Basic page definition and formatting.
3 //>>label: Page Creation
6 define( [ "jquery", "../jquery.mobile.widget" ], function( $ ) {
7 //>>excludeEnd("jqmBuildExclude");
8 (function( $, undefined ) {
10 $.widget( "mobile.page", $.mobile.widget, {
14 keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')"
21 // if false is returned by the callbacks do not create the page
22 if ( self._trigger( "beforecreate" ) === false ) {
27 .attr( "tabindex", "0" )
28 .addClass( "ui-page ui-body-" + self.options.theme )
29 .bind( "pagebeforehide", function() {
30 self.removeContainerBackground();
32 .bind( "pagebeforeshow", function() {
33 self.setContainerBackground();
38 removeContainerBackground: function() {
39 $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) );
42 // set the page container background to the page theme
43 setContainerBackground: function( theme ) {
44 if ( this.options.theme ) {
45 $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
49 keepNativeSelector: function() {
50 var options = this.options,
51 keepNativeDefined = options.keepNative && $.trim( options.keepNative );
53 if ( keepNativeDefined && options.keepNative !== options.keepNativeDefault ) {
54 return [options.keepNative, options.keepNativeDefault].join( ", " );
57 return options.keepNativeDefault;
61 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
63 //>>excludeEnd("jqmBuildExclude");