This commit is contained in:
davidwoody 2015-01-09 20:16:41 -05:00
parent e6e53d62b9
commit bbc9bd48bf

View file

@ -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';
}
},