Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed minscroll to 250, better organization of lastscroll

  • Loading branch information...
commit 003505a4b9d64a37997710efebe06b5d8823b5de 1 parent ac67e92
scottjehl authored
Showing with 12 additions and 6 deletions.
  1. +1 −1  js/jquery.mobile.core.js
  2. +11 −5 js/jquery.mobile.navigation.js
View
2  js/jquery.mobile.core.js
@@ -36,7 +36,7 @@
defaultPageTransition: "slide",
// Minimum scroll distance that will be remembered when returning to a page
- minScrollBack: screen.height / 2,
+ minScrollBack: 250,
// Set default dialog transition - 'none' for no transitions
defaultDialogTransition: "pop",
View
16 js/jquery.mobile.navigation.js
@@ -385,6 +385,15 @@
$.mobile.changePage.apply( null, pageTransitionQueue.pop() );
}
}
+
+ // Save last scroll distance
+ $( document ).bind( "beforechangepage", function(){
+ var active = $.mobile.urlHistory.getActive();
+ if( active ){
+ active.lastScroll = $( window ).scrollTop();
+ }
+ });
+
//function for transitioning between two existing pages
function transitionPages( toPage, fromPage, transition, reverse ) {
@@ -452,6 +461,8 @@
return pageMin;
}
+
+ $.mobile.getScreenHeight = getScreenHeight;
//simply set the active page's minimum height to screen height, depending on orientation
function resetActivePageHeight(){
@@ -893,11 +904,6 @@
isForward: function() { historyDir = 1; }
});
}
-
- // Set active item's lastScroll prop
- if( active ){
- active.lastScroll = $( window ).scrollTop();
- }
// Kill the keyboard.
// XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
Please sign in to comment.
Something went wrong with that request. Please try again.