<commit_before>var Backbone = require('backbone');
var ButtonView = require('./ButtonView');

module.exports = Backbone.View.extend({
  initialize(o) {
    this.opt = o || {};
    this.config = this.opt.config || {};
    this.pfx = this.config.stylePrefix || '';
    this.parentM = this.opt.parentM || null;
    this.listenTo(this.collection, 'add', this.addTo);
    this.listenTo(this.collection, 'reset', this.render);
    this.className = this.pfx + 'buttons';
  },

  /**
   * Add to collection
   * @param Object Model
   *
   * @return Object
   * */
  addTo(model) {
    this.addToCollection(model);
  },

  /**
   * Add new object to collection
   * @param  Object  Model
   * @param  Object   Fragment collection
   *
   * @return Object Object created
   * */
  addToCollection(model, fragmentEl) {
    var fragment = fragmentEl || null;
    var viewObject = ButtonView;

    var view = new viewObject({<commit_msg>Add `remove` listener to buttons in panels. Closes #824<commit_after>var Backbone = require('backbone');
var ButtonView = require('./ButtonView');

module.exports = Backbone.View.extend({
  initialize(o) {
    this.opt = o || {};
    this.config = this.opt.config || {};
    this.pfx = this.config.stylePrefix || '';
    this.parentM = this.opt.parentM || null;
    this.listenTo(this.collection, 'add', this.addTo);
    this.listenTo(this.collection, 'reset remove', this.render);
    this.className = this.pfx + 'buttons';
  },

  /**
   * Add to collection
   * @param Object Model
   *
   * @return Object
   * */
  addTo(model) {
    this.addToCollection(model);
  },

  /**
   * Add new object to collection
   * @param  Object  Model
   * @param  Object   Fragment collection
   *
   * @return Object Object created
   * */
  addToCollection(model, fragmentEl) {
    var fragment = fragmentEl || null;
    var viewObject = ButtonView;

    var view = new viewObject({
{'fraction_non_alphanumeric': 0.14428646656134808, 'fraction_numerical': 0.001579778830963665, 'mean_word_length': 2.9832285115303985, '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': '946985', 'n_tokens_mistral': 603, 'n_tokens_neox': 593, 'n_words': 140}