<commit_before>import Marionette from 'backbone.marionette';

const template = require('./ModalView.hbs');
// require('./ModalView.css');


const PanelView = Marionette.LayoutView.extend(/** @lends core/views.PanelView# */{
  template,

  className: 'modal fade',

  regions: {
    content: '.modal-body',
  },

  events() {
    const baseEvents = {
      'click .close': 'close',
      'shown.bs.modal': 'onModalShown',
    };

    const buttons = this.options.buttons || [];
    for (let i = 0; i < buttons.length; ++i) {
      baseEvents[`click .modal-footer button:eq(${i})`] = buttons[i][1];
    }

    return baseEvents;
  },

  initialize(options) {
    this.view = options.view;
    this.title = options.title;
    this.icon = options.icon;
    this.closed = options.closed;
    this.closeable = typeof options.closeable === 'undefined' ? true : options.closeable;
    this.buttonDescs = options.buttons || [];
  },

  templateHelpers() {
    return {
      title: this.title,
      icon: this.icon,
      closeable: this.closeable,
      hasButtons: this.buttonDescs.length > 0,
      buttons: this.buttonDescs.map(buttonDesc => buttonDesc[0]),
    };
  },

  onAttach() {
    this.initialDisplay = this.$el.css('display');
    this.$el.modal('show');
  },

  onModalShown() {
    this.showChildView('content', this.view);
  },

  /**
    Show the Panel when it was not visible before.
   */
  open() {
    // this.$el.css('display', this.initialDisplay);
    this.$el.modal('show');
    this.closed = false;
  },

  /**
    Close the Panel when open before.
   */
  close() {
    // this.$el.css('display', 'none');
    this.$el.modal('hide');
    this.closed = true;
  },

  /**
    Toggle the visibility of the Panel.
   */
  toggleOpen() {
    if (this.closed) {
      this.open();
    } else {
      this.close();
    }
  },

  getView() {
    return this.view;
  },
});


export default PanelView;
<commit_msg>Cleanup.<commit_after>import Marionette from 'backbone.marionette';

const template = require('./ModalView.hbs');
// require('./ModalView.css');


const PanelView = Marionette.LayoutView.extend(/** @lends core/views.PanelView# */{
  template,

  className: 'modal fade',

  regions: {
    content: '.modal-body',
  },

  events() {
    const baseEvents = {
      'click .close': 'close',
      'shown.bs.modal': 'onModalShown',
    };

    const buttons = this.options.buttons || [];
    for (let i = 0; i < buttons.length; ++i) {
      baseEvents[`click .modal-footer button:eq(${i})`] = buttons[i][1];
    }

    return baseEvents;
  },

  initialize(options) {
    this.view = options.view;
    this.title = options.title;
    this.icon = options.icon;
    this.closed = options.closed;
    this.closeable = typeof options.closeable === 'undefined' ? true : options.closeable;
    this.buttonDescs = options.buttons || [];
  },

  templateHelpers() {
    return {
      title: this.title,
      icon: this.icon,
      closeable: this.closeable,
      hasButtons: this.buttonDescs.length > 0,
      buttons: this.buttonDescs.map(buttonDesc => buttonDesc[0]),
    };
  },

  onAttach() {
    this.initialDisplay = this.$el.css('display');
    this.$el.modal('show');
  },

  onModalShown() {
    this.showChildView('content', this.view);
  },

  /**
    Show the Panel when it was not visible before.
   */
  open() {
    this.$el.modal('show');
    this.closed = false;
  },

  /**
    Close the Panel when open before.
   */
  close() {
    this.$el.modal('hide');
    this.closed = true;
  },

  /**
    Toggle the visibility of the Panel.
   */
  toggleOpen() {
    if (this.closed) {
      this.open();
    } else {
      this.close();
    }
  },

  getView() {
    return this.view;
  },
});


export default PanelView;

{'fraction_non_alphanumeric': 0.17057569296375266, 'fraction_numerical': 0.0021321961620469083, 'mean_word_length': 2.5845272206303727, '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': '2238854', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1229, 'n_words': 250}