Skip to content

Commit 00e8baf

Browse files
author
scottjehl
committed
changed minscroll to 250, better organization of lastscroll
1 parent 08b3028 commit 00e8baf

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

js/jquery.mobile.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
defaultPageTransition: "slide",
3737

3838
// Minimum scroll distance that will be remembered when returning to a page
39-
minScrollBack: screen.height / 2,
39+
minScrollBack: 250,
4040

4141
// Set default dialog transition - 'none' for no transitions
4242
defaultDialogTransition: "pop",

js/jquery.mobile.navigation.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,15 @@
385385
$.mobile.changePage.apply( null, pageTransitionQueue.pop() );
386386
}
387387
}
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+
388397

389398
//function for transitioning between two existing pages
390399
function transitionPages( toPage, fromPage, transition, reverse ) {
@@ -452,6 +461,8 @@
452461

453462
return pageMin;
454463
}
464+
465+
$.mobile.getScreenHeight = getScreenHeight;
455466

456467
//simply set the active page's minimum height to screen height, depending on orientation
457468
function resetActivePageHeight(){
@@ -891,11 +902,6 @@
891902
isForward: function() { historyDir = 1; }
892903
});
893904
}
894-
895-
// Set active item's lastScroll prop
896-
if( active ){
897-
active.lastScroll = $( window ).scrollTop();
898-
}
899905

900906
// Kill the keyboard.
901907
// XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,

0 commit comments

Comments
 (0)