<commit_before>import { EventAggregator } from 'aurelia-event-aggregator';
import { bindable, inject } from 'aurelia-framework';
import { Router } from 'aurelia-router';

@inject(EventAggregator)
export class NavBarCustomElement {
  @bindable public router: Router;
  public activeScenarioLabel = '';
  // private sideNav: any;
  private sideNavVisible = true;

  constructor(private ea: EventAggregator) {}

  public attached() {
    // this.sideNav = ($('.button-collapse') as any).sideNav;
    // this.sideNav({
    //   menuWidth: 300, // Default is 300
    //   // edge: 'right', // Choose the horizontal origin
    //   closeOnClick: true, // Closes side-nav on <a> clicks, useful for Angular/Meteor
    //   draggable: true // Choose whether you can drag to open on touch screens,
    //   // onOpen: function(el) { /* Do Stuff* / }, // A function to be called when sideNav is opened
    //   // onClose: function(el) { /* Do Stuff* / }, // A function to be called when sideNav is closed
    // });
    this.ea.subscribe('activeScenarioChanged', (data: { id: string | number, title: string }) => {
      this.activeScenarioLabel = data && data.title
        ? `${data.title} | `
        : '';
    });
  }

  public toggleMenu() {
    this.sideNavVisible = !this.sideNavVisible;
    // this.sideNav(this.sideNavVisible ? 'show' : 'hide');
    ($('.button-collapse') as any).sideNav('show');
  }


}<commit_msg>NavBar listens to scenario changed events.<commit_after>import { IScenario } from './../../models/scenario';
import { EventAggregator } from 'aurelia-event-aggregator';
import { bindable, inject } from 'aurelia-framework';
import { Router } from 'aurelia-router';

@inject(EventAggregator)
export class NavBarCustomElement {
  @bindable public router: Router;
  public activeScenarioLabel = '';
  // private sideNav: any;
  private sideNavVisible = true;

  constructor(private ea: EventAggregator) {}

  public attached() {
    // this.sideNav = ($('.button-collapse') as any).sideNav;
    // this.sideNav({
    //   menuWidth: 300, // Default is 300
    //   // edge: 'right', // Choose the horizontal origin
    //   closeOnClick: true, // Closes side-nav on <a> clicks, useful for Angular/Meteor
    //   draggable: true // Choose whether you can drag to open on touch screens,
    //   // onOpen: function(el) { /* Do Stuff* / }, // A function to be called when sideNav is opened
    //   // onClose: function(el) { /* Do Stuff* / }, // A function to be called when sideNav is closed
    // });
    this.ea.subscribe('activeScenarioChanged', (scenario: IScenario) => {
      this.activeScenarioLabel = scenario && scenario.title
        ? `${scenario.title} | `
        : '';
    });
  }

  public toggleMenu() {
    this.sideNavVisible = !this.sideNavVisible;
    // this.sideNav(this.sideNavVisible ? 'show' : 'hide');
    ($('.button-collapse') as any).sideNav('show');
  }


}
{'fraction_non_alphanumeric': 0.15132712857635297, 'fraction_numerical': 0.004136504653567736, 'mean_word_length': 2.937584803256445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6530113', 'n_tokens_mistral': 902, 'n_tokens_neox': 879, 'n_words': 243}