I'm starting to think that if I can set the jqmData('lastScroll', 0); when each of my pages is created, I cold probably fix my issue, but no matter what I do I can't seem to set that damn value, can anyone enlighten me as to where that gets set? I suspect we need to set it here:
initializePage: function() {
[...]
$pages.add( ":jqmData(role='dialog')" ).each(function(){
var $this = $(this);
// unless the data url is already set set it to the id
if( !$this.jqmData('url') ){
$this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) );
}
/* Magical setting of the lastScroll parm to 0 for every page so that I get nice smooth scrolling for my app unless the user mucks about with it. Yup, set it right here, but my pages are still scrolling all the way down after transitioning ...*/
$($this).jqmData("lastScroll", 0); // <- YAY! That does it, unfortunately, the transition engine or browser don't seem to care...
});
[...]
}
DOH! Ok, no love on that one... back to the drawing board, i now suspect it's in:
function transitionPages( toPage, fromPage, transition, reverse )
I will experiment a lil bit and report my findings...
Ok, so it was in:
promise.done(function() {
[...]
//jump to top or prev scroll, sometimes on iOS the page has not rendered yet.
if( toScroll ){
$.mobile.silentScroll( toScroll );
$( document ).one( "silentscroll", function() { reFocus( toPage ); } );
}
else{
reFocus( toPage );
}
window.scrollTo(0,0); <- Reset page position just before load, works in Chrome / Webkit, but I have no iphone to test with. This should reliably send your browser to the top of the screen every time though, at least it looks hopeful! Yay! Go me.
[...]
});