Skip to content
This repository
Browse code

changed minscroll to 250, better organization of lastscroll

  • Loading branch information...
commit 003505a4b9d64a37997710efebe06b5d8823b5de 1 parent ac67e92
authored August 26, 2011
2  js/jquery.mobile.core.js
@@ -36,7 +36,7 @@
36 36
 		defaultPageTransition: "slide",
37 37
 
38 38
 		// Minimum scroll distance that will be remembered when returning to a page
39  
-		minScrollBack: screen.height / 2,
  39
+		minScrollBack: 250,
40 40
 
41 41
 		// Set default dialog transition - 'none' for no transitions
42 42
 		defaultDialogTransition: "pop",
16  js/jquery.mobile.navigation.js
@@ -385,6 +385,15 @@
385 385
 			$.mobile.changePage.apply( null, pageTransitionQueue.pop() );
386 386
 		}
387 387
 	}
  388
+	
  389
+	// Save last scroll distance
  390
+	$( document ).bind( "beforechangepage", function(){
  391
+		var active	= $.mobile.urlHistory.getActive();
  392
+		if( active ){
  393
+			active.lastScroll = $( window ).scrollTop();
  394
+		}
  395
+	});
  396
+	
388 397
 
389 398
 	//function for transitioning between two existing pages
390 399
 	function transitionPages( toPage, fromPage, transition, reverse ) {
@@ -452,6 +461,8 @@
452 461
 
453 462
 		return pageMin;
454 463
 	}
  464
+	
  465
+	$.mobile.getScreenHeight = getScreenHeight;
455 466
 
456 467
 	//simply set the active page's minimum height to screen height, depending on orientation
457 468
 	function resetActivePageHeight(){
@@ -893,11 +904,6 @@
893 904
 				isForward:	function() { historyDir = 1; }
894 905
 			});
895 906
 		}
896  
-		
897  
-		// Set active item's lastScroll prop
898  
-		if( active ){
899  
-			active.lastScroll = $( window ).scrollTop();
900  
-		}
901 907
 
902 908
 		// Kill the keyboard.
903 909
 		// XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,

0 notes on commit 003505a

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