<commit_before>define([
  'client/controllers/module',
  'common/modules/tab',
  'client/views/visualisations/tab'
],
function (ModuleController, TabController, TabView) {

  var parent = ModuleController.extend(TabController);

  var TabModule = parent.extend({

    visualisationClass: TabView,

    initialize: function () {
      var controllerMap = TabModule.map;

      this.tabs = _.map(this.model.get('tabs'), function (tab) {
        tab.controller = controllerMap[tab['module-type']];
        return tab;
      }, this);

      if (!this.model.has('activeIndex')) {
        this.model.set('activeIndex', 0);
      }

      parent.prototype.initialize.apply(this, arguments);
    },

    ready: function () {
      this.listenTo(this.model, 'change:activeIndex', this.renderTabs, this);
      this.renderTabs();
    },

    renderTabs: function () {
      var tab = this.tabs[this.model.get('activeIndex')];<commit_msg>Fix tabbed views<commit_after>define([
  'client/controllers/module',
  'common/modules/tab',
  'client/views/visualisations/tab',
  'extensions/collections/collection'
],
function (ModuleController, TabController, TabView, Collection) {

  var parent = ModuleController.extend(TabController);

  var TabModule = parent.extend({

    visualisationClass: TabView,
    collectionClass: Collection,

    initialize: function () {
      var controllerMap = TabModule.map;

      this.tabs = _.map(this.model.get('tabs'), function (tab) {
        tab.controller = controllerMap[tab['module-type']];
        return tab;
      }, this);

      if (!this.model.has('activeIndex')) {
        this.model.set('activeIndex', 0);
      }

      parent.prototype.initialize.apply(this, arguments);
    },

    ready: function () {
      this.listenTo(this.model, 'change:activeIndex', this.renderTabs, this);
      this.renderTabs();
    },

    renderTabs: function () {
      var tab = this.tabs[this.model.get('activeIndex')];
{'fraction_non_alphanumeric': 0.1471950591868245, 'fraction_numerical': 0.001029336078229542, 'mean_word_length': 3.3104212860310422, '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': '5491946', 'n_tokens_mistral': 591, 'n_tokens_neox': 566, 'n_words': 101}