Permalink
Browse files

Page: deprecate setContainerBackground and removeContainerBackground …

…move to content widget
  • Loading branch information...
arschmitz committed Aug 7, 2013
1 parent c5372d1 commit e6ff092510ac1285e073e8b600f125e186363e8d
Showing with 20 additions and 22 deletions.
  1. +15 −0 js/jquery.mobile.navigation.js
  2. +5 −22 js/widgets/page.js
@@ -19,6 +19,10 @@ define( [
(function( $, undefined ) {
$.widget( "mobile.content", {
options: {
theme: "a"
},
initSelector: false,
_create: function() {
@@ -52,6 +56,17 @@ define( [
}, this));
},
_setOptions: function( options ){
if ( options.theme !== undefined && options.theme !== "none" ) {
this.element.removeClass( "ui-overlay-" + this.options.theme )
.addClass( "ui-overlay-" + options.theme );
} else if ( options.theme !== undefined ) {
this.element.removeClass( "ui-overlay-" + this.options.theme );
}
this._super( options );
},
_disableRecordScroll: function() {
this.setLastScrollEnabled = false;
},
View
@@ -121,33 +121,16 @@ $.widget( "mobile.page", {
_handlePageBeforeShow: function(/* e */) {
this.setContainerBackground();
},
// Deprecated in 1.4 remove in 1.5
removeContainerBackground: function() {
var classes = ( $.mobile.pageContainer.attr( "class" ) || "" ).split( " " ),
overlayTheme = null,
matches;
while ( classes.length > 0 ) {
overlayTheme = classes.pop();
matches = ( new RegExp( "^ui-overlay-([a-z])$" ) ).exec( overlayTheme );
if ( matches && matches.length > 1 ) {
overlayTheme = matches[ 1 ];
break;
} else {
overlayTheme = null;
}
}
$.mobile.pageContainer.removeClass( "ui-overlay-" + overlayTheme );
this.element.closest( ":mobile-content" ).content({ "theme": "none" });
},
// Deprecated in 1.4 remove in 1.5
// set the page container background to the page theme
setContainerBackground: function( theme ) {
if ( this.options.theme ) {
$.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
}
this.element.parent().content( { "theme": theme || this.options.theme } );
},
// Deprecated in 1.4 remove in 1.5
keepNativeSelector: function() {
var options = this.options,
keepNativeDefined = options.keepNative && $.trim( options.keepNative );

0 comments on commit e6ff092

Please sign in to comment.