mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
|
|
//>>description: Basic page formatting.
|
|
//>>label: Pages
|
|
|
|
define( [ "jquery", "./jquery.mobile.widget" ], function( $ ) {
|
|
//>>excludeEnd("jqmBuildExclude");
|
|
(function( $, undefined ) {
|
|
|
|
$.widget( "mobile.page", $.mobile.widget, {
|
|
options: {
|
|
theme: "c",
|
|
domCache: false,
|
|
keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')"
|
|
},
|
|
|
|
_create: function() {
|
|
|
|
// if false is returned by the callbacks do not create the page
|
|
if( this._trigger( "beforecreate" ) === false ){
|
|
return false;
|
|
}
|
|
|
|
this.element
|
|
.attr( "tabindex", "0" )
|
|
.addClass( "ui-page ui-body-" + this.options.theme );
|
|
},
|
|
|
|
keepNativeSelector: function() {
|
|
var options = this.options,
|
|
keepNativeDefined = options.keepNative && $.trim(options.keepNative);
|
|
|
|
if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){
|
|
return [options.keepNative, options.keepNativeDefault].join(", ");
|
|
}
|
|
|
|
return options.keepNativeDefault;
|
|
}
|
|
});
|
|
})( jQuery );
|
|
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
|
|
});
|
|
//>>excludeEnd("jqmBuildExclude");
|