<commit_before>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;
  }
});

Template.ionTab.helpers({
  url: function () {
    if (this.href) {
      return this.href;
    }

    if (this.path) {
      return Router.routes[this.path].path(Template.parentData(1));
    }
  },

  isActive: function () {
    if (this.path && this.path === Session.get('currentTab')) {
      return 'active';
    }
  },

  activeIcon: function () {
    if (this.iconOn) {
      return this.iconOn;
    } else {
      return this.icon;
    }
  },

  defaultIcon: function () {
    if (this.iconOff) {
      return this.iconOff;
    } else {
      return this.icon;
    }
  }
});<commit_msg>active tab tied to route. fixes #18<commit_after>Template.ionTab.events({
  'click': function (event, template) {
    // 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;
  }
});

Template.ionTab.helpers({
  url: function () {
    if (this.href) {
      return this.href;
    }

    if (this.path) {
      return Router.routes[this.path].path(Template.parentData(1));
    }
  },

  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) {
      return 'active';
    }
  },

  activeIcon: function () {
    if (this.iconOn) {
      return this.iconOn;
    } else {
      return this.icon;
    }
  },

  defaultIcon: function () {
    if (this.iconOff) {
      return this.iconOff;
    } else {
      return this.icon;
    }
  }
});
{'fraction_non_alphanumeric': 0.1437125748502994, 'fraction_numerical': 0.00249500998003992, 'mean_word_length': 2.404074702886248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5972702', 'n_tokens_mistral': 667, 'n_tokens_neox': 652, 'n_words': 151}