From 347014530e78a582a59f1ba7dc938a88efc4e371 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 11 Jan 2012 23:29:50 +0700 Subject: [PATCH] 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 --- js/jquery.mobile.dialog.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 23902b6a..38535c6d 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -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(){