changed minscroll to 250, better organization of lastscroll

This commit is contained in:
scottjehl 2011-08-26 18:16:43 -04:00
parent ac67e92cbb
commit 003505a4b9
2 changed files with 12 additions and 6 deletions

View file

@ -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 file

@ -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,