From ea8516618e827bbf5b41bf295ea305a7830b826d Mon Sep 17 00:00:00 2001 From: tomwasd Date: Tue, 28 Apr 2015 08:05:19 +0100 Subject: [PATCH] IonScrollPositions based on route path rather than route name --- components/ionNavBackButton/ionNavBackButton.js | 2 +- components/ionView/ionView.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/ionNavBackButton/ionNavBackButton.js b/components/ionNavBackButton/ionNavBackButton.js index 991eb7a..19849b6 100644 --- a/components/ionNavBackButton/ionNavBackButton.js +++ b/components/ionNavBackButton/ionNavBackButton.js @@ -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({ diff --git a/components/ionView/ionView.js b/components/ionView/ionView.js index 3377d09..07a0135 100644 --- a/components/ionView/ionView.js +++ b/components/ionView/ionView.js @@ -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]; } };