From 3bd713c185f75e194a7ed71d57a0f549cdd893bd Mon Sep 17 00:00:00 2001 From: scottjehl Date: Fri, 17 Jun 2011 16:24:09 -0400 Subject: [PATCH] added resetActivePage on pagecreate, orientationchange, and after transitions. --- js/jquery.mobile.navigation.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index def9783f..08336ced 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -443,11 +443,22 @@ //trigger pageshow, define prevPage as either fromPage or empty jQuery obj toPage.data( "page" )._trigger( "show", null, { prevPage: fromPage || $( "" ) } ); + + resetActivePageHeight(); }); return promise; }; + + //simply set the active page's minimum height to screen height, depending on orientation + function resetActivePageHeight(){ + var height = jQuery.event.special.orientationchange.orientation() == "portrait" ? screen.height : screen.width, + winHeight = $( window ).height(), + pageMin = Math.min( height, winHeight ); + + $( ".ui-page-active" ).css( "min-height", pageMin ); + } //shared page enhancements function enhancePage( $page, role ) { @@ -1117,5 +1128,8 @@ $.mobile.changePage( $.mobile.firstPage, { transition: transition, changeHash: false, fromHashChange: true } ); } }); + + //set page min-heights to be device specific + $( document ).bind( "pagecreate orientationchange", resetActivePageHeight ); })( jQuery );