if there's an overlay theme, we're going to remove it from the page container. First though, check that the incoming page isn't a dialog with the same overlay theme. If so, don't remove the class, as it'll remove it for the next one too

This commit is contained in:
scottjehl 2012-01-11 23:29:50 +07:00
parent 473802e26e
commit f7aa71d423

View file

@ -60,10 +60,15 @@ $.widget( "mobile.dialog", $.mobile.widget, {
.attr( "data-" + $.mobile.ns + "direction", "reverse" );
}
})
.bind( "pagehide", function() {
.bind( "pagehide", function( e, ui ) {
$( this ).find( "." + $.mobile.activeBtnClass ).removeClass( $.mobile.activeBtnClass );
// if there's an overlay theme, we're going to remove it from the page container.
// First though, check that the incoming page isn't a dialog with the same theme. If so, don't remove.
if( self.options.overlayTheme ){
$.mobile.pageContainer.removeClass( "ui-body-" + self.options.overlayTheme );
if( !ui.nextPage || !ui.nextPage.is( ".ui-dialog-page.ui-overlay-" + self.options.overlayTheme ) ){
$.mobile.pageContainer.removeClass( "ui-overlay-" + self.options.overlayTheme );
}
}
})
.bind( "pagebeforeshow", function(){