IonScrollPositions based on route path rather than route name

This commit is contained in:
tomwasd 2015-04-28 08:05:19 +01:00
parent a5a7c6819a
commit ea8516618e
2 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
IonScrollPositions = {};
Router.onStop(function () {
IonScrollPositions[Router.current().route.getName()] = $('.overflow-scroll').scrollTop();
IonScrollPositions[this.route.path(this.params)] = $('.overflow-scroll').scrollTop();
});
Template.ionNavBackButton.events({

View file

@ -3,10 +3,10 @@ Template.ionView.rendered = function () {
IonNavigation.skipTransitions = false;
// Reset our scroll position
var routeName = Router.current().route.getName();
if(IonScrollPositions[routeName]) {
$('.overflow-scroll').scrollTop(IonScrollPositions[routeName]);
delete IonScrollPositions[routeName];
var routePath = Router.current().route.path(Router.current().params);
if(IonScrollPositions[routePath]) {
$('.overflow-scroll').scrollTop(IonScrollPositions[routePath]);
delete IonScrollPositions[routePath];
}
};