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

var OverlayView = Mn.ItemView.extend({
  className: 'overlay-view hide',

  // The OverlayView doesn't need a template: it's simply an element
  // that covers up the entirety of the application
  template: false,

  // Convert click DOM events into BB Events
  events: {
    click: '_handleClick'
  },

  // Whether or not the view is currently displaying
  isDisplaying() {
    return this._isDisplaying;
  },

  // Shows the overlay. Then, when it's clicked, close it.
  display() {
    if (this._isDisplaying) { return; }
    this._isDisplaying = true;
    this.$el.removeClass('hide');
    this.once('click', this.hide);
    this.trigger('display');
  },

  // Hide the overlay.
  hide() {
    if (!this._isDisplaying) { return; }
    this._isDisplaying = false;
    this.$el.addClass('hide');
    // Ensure that the click event has been unregistered
    this.off('click');
    this.trigger('hide');
  },

  // Whether or not the overlayView is displayed
  _isDisplaying: false,

  // Emit the `click` event if the overlay is clicked directly.
  // Otherwise, emit a `click:child` event.
  _handleClick(e) {
    var clickedSelf = e.target === e.currentTarget;
    var eventName = self ? 'click' : 'click:child';
    this.trigger(eventName);
  }
});

Mn.OverlayView = OverlayView;

export default OverlayView;<commit_msg>Fix bug in handleClick method.<commit_after>import Mn from 'backbone.marionette';

var OverlayView = Mn.ItemView.extend({
  className: 'overlay-view hide',

  // The OverlayView doesn't need a template: it's simply an element
  // that covers up the entirety of the application
  template: false,

  // Convert click DOM events into BB Events
  events: {
    click: '_handleClick'
  },

  // Whether or not the view is currently displaying
  isDisplaying() {
    return this._isDisplaying;
  },

  // Shows the overlay. Then, when it's clicked, close it.
  display() {
    if (this._isDisplaying) { return; }
    this._isDisplaying = true;
    this.$el.removeClass('hide');
    this.once('click', this.hide);
    this.trigger('display');
  },

  // Hide the overlay.
  hide() {
    if (!this._isDisplaying) { return; }
    this._isDisplaying = false;
    this.$el.addClass('hide');
    // Ensure that the click event has been unregistered
    this.off('click');
    this.trigger('hide');
  },

  // Whether or not the overlayView is displayed
  _isDisplaying: false,

  // Emit the `click` event if the overlay is clicked directly.
  // Otherwise, emit a `click:child` event.
  _handleClick(e) {
    var clickedSelf = e.target === e.currentTarget;
    var eventName = clickedSelf ? 'click' : 'click:child';
    this.trigger(eventName);
  }
});

Mn.OverlayView = OverlayView;

export default OverlayView;
{'fraction_non_alphanumeric': 0.12544931703810208, 'fraction_numerical': 0.0, 'mean_word_length': 3.20392749244713, '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': '338434', 'n_tokens_mistral': 881, 'n_tokens_neox': 843, 'n_words': 263}