diff --git a/components/ionTab/ionTab.js b/components/ionTab/ionTab.js index aa3e212..ffd6b3a 100644 --- a/components/ionTab/ionTab.js +++ b/components/ionTab/ionTab.js @@ -1,5 +1,9 @@ Template.ionTab.events({ 'click': function (event, template) { + if (template.data.path) { + Session.set('currentTab', template.data.path); + } + // If the tab's content is being rendered inside of a ionNavView // we don't want to slide it in when switching tabs IonNavigation.skipTransitions = true; @@ -18,14 +22,7 @@ Template.ionTab.helpers({ }, isActive: function () { - // reactive data source - var currentPath = Router.current().route.path(); - - if(this.href && this.href === currentPath){ - return 'active'; - } - - if (this.path && Router.routes[this.path].path(Template.parentData(1)) === currentPath) { + if (this.path && this.path === Session.get('currentTab')) { return 'active'; } },