changed setting of lastScroll

This commit is contained in:
scottjehl 2011-09-06 14:29:19 -04:00
parent 97539ed3bd
commit 0d98b8fad6

View file

@ -383,7 +383,14 @@
$( document ).bind( "beforechangepage", function(){
var active = $.mobile.urlHistory.getActive();
if( active ){
active.lastScroll = $( window ).scrollTop();
var lastScroll = $( window ).scrollTop();
//if the Y location we're scrolling to is less than minScrollBack, let it go for sake of smoothness
if( lastScroll < $.mobile.minScrollBack ){
lastScroll = $.mobile.defaultHomeScroll;
}
active.lastScroll = lastScroll;
}
});
@ -399,11 +406,6 @@
// Scroll to top
window.scrollTo( 0, $.mobile.defaultHomeScroll );
//if the Y location we're scrolling to is less than 10px, let it go for sake of smoothness
if( toScroll < $.mobile.minScrollBack ){
toScroll = 0;
}
if( fromPage ) {
//trigger before show/hide events
fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } );