Skip to content
This repository
Browse code

internally, we only use getScreenHeight during transitions, but it's …

…exposed on $.mobile as well. For a while, it's been returning incorrect values in iOS, as it wasn't taking into account the browser chrome's footer height. window.innerHeight tends to return the value we need more consistently, but it's not supported in older browsers so I've included the jQuery height call as a fallback too.
  • Loading branch information...
commit aad7df1da1af35176ea54a12edc56087e7b791fd 1 parent ab6a635
authored

Showing 1 changed file with 3 additions and 8 deletions. Show diff stats Hide diff stats

  1. 11  js/jquery.mobile.navigation.js
11  js/jquery.mobile.navigation.js
@@ -508,14 +508,9 @@ define( [
508 508
 
509 509
 	//simply set the active page's minimum height to screen height, depending on orientation
510 510
 	function getScreenHeight(){
511  
-		var orientation 	= $.event.special.orientationchange.orientation(),
512  
-			port			= orientation === "portrait",
513  
-			winMin			= port ? 480 : 320,
514  
-			screenHeight	= port ? screen.availHeight : screen.availWidth,
515  
-			winHeight		= Math.max( winMin, $( window ).height() ),
516  
-			pageMin			= Math.min( screenHeight, winHeight );
517  
-
518  
-		return pageMin;
  511
+		// Native innerHeight returns more accurate value for this across platforms, 
  512
+		// jQuery version is here as a normalized fallback for platforms like Symbian
  513
+		return window.innerHeight || $( window ).height();
519 514
 	}
520 515
 
521 516
 	$.mobile.getScreenHeight = getScreenHeight;

1 note on commit aad7df1

Thank you. I was noticing this issue on IOS with my mobile chat window (the footer would hang half past the page with iOS and I couldn't fix it). This fixed the problem.

Please sign in to comment.
Something went wrong with that request. Please try again.