diff --git a/js/jquery.mobile.media.js b/js/jquery.mobile.media.js index 7c0dbde0..c1762643 100644 --- a/js/jquery.mobile.media.js +++ b/js/jquery.mobile.media.js @@ -105,6 +105,14 @@ $(document).bind("mobileinit.htmlclass", function(){ //add orientation class to HTML element on flip/resize. if(event.orientation){ $html.removeClass( "portrait landscape" ).addClass( event.orientation ); + //Set the min-height to the size of the fullscreen. This is to fix issue #455 + if( event.orientation === 'portrait' ) { + $( '.ui-page' ).css( 'minHeight', ( screen.availHeight >= screen.availWidth ) ? screen.availHeight : screen.availWidth); + } else { + $( '.ui-page' ).css( 'minHeight', ( screen.availHeight <= screen.availWidth ) ? screen.availHeight : screen.availWidth); + } + + $.mobile.silentScroll(); } //add classes to HTML element for min/max breakpoints detectResolutionBreakpoints(); diff --git a/js/jquery.mobile.page.js b/js/jquery.mobile.page.js index 6afa07ed..74d6548c 100644 --- a/js/jquery.mobile.page.js +++ b/js/jquery.mobile.page.js @@ -37,6 +37,12 @@ $.widget( "mobile.page", $.mobile.widget, { if ( this._trigger( "beforeCreate" ) === false ) { return; } + + if( $( "html" ).hasClass( 'portrait' ) ) { + $elem.css( 'minHeight', ( screen.availHeight >= screen.availWidth ) ? screen.availHeight : screen.availWidth); + } else { + $elem.css( 'minHeight', ( screen.availHeight <= screen.availWidth ) ? screen.availHeight : screen.availWidth); + } //some of the form elements currently rely on the presence of ui-page and ui-content // classes so we'll handle page and content roles outside of the main role processing