mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-14 17:43:10 +00:00
added resetActivePage on pagecreate, orientationchange, and after transitions.
This commit is contained in:
parent
690dc66f7c
commit
3bd713c185
1 changed files with 14 additions and 0 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue