mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-26 22:06:41 -06:00
IonScrollPositions based on route path rather than route name
This commit is contained in:
parent
a5a7c6819a
commit
ea8516618e
2 changed files with 5 additions and 5 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue