Only scroll entering nav view, not the one you're leaving.

If you had already been to a page previously, and then navigated away from it, there was a flash of it's previous scroll position that showed.  This ensures that only the view that is being animated in to view, is scrolled to the correct position, and the one leaving the view is left alone.
This commit is contained in:
Jamie Loberman 2015-07-08 11:51:22 -07:00
parent bcd018e428
commit 45dd4d61b8

View file

@ -5,7 +5,7 @@ Template.ionView.rendered = function () {
// Reset our scroll position
var routePath = Router.current().route.path(Router.current().params);
if(IonScrollPositions[routePath]) {
$('.overflow-scroll').scrollTop(IonScrollPositions[routePath]);
$('.overflow-scroll').not('.nav-view-leaving .overflow-scroll').scrollTop(IonScrollPositions[routePath]);
delete IonScrollPositions[routePath];
}
};