<commit_before>(function(app) {
  'use strict';

  var Draggable = app.Draggable || require('./draggable.js');
  var Events = app.Events || require('../base/events.js');

  var Button = function(el) {
    this.el = el;
    this._events = new Events();
    this._draggable = new Draggable(this.el, {
      onstart: this._onstart.bind(this),
      onmove: function() { /* do nothing */ },
      onend: this._onend.bind(this),
    });
    this._dragTarget = null;
  };

  Button.prototype.init = function() {
    this._draggable.enable();
  };

  Button.prototype.on = function() {
    return Events.prototype.on.apply(this._events, arguments);
  };

  Button.prototype._onstart = function(event) {
    event.preventDefault();
    this._dragTarget = event.target;
    this._events.emit('pointerdown');
  };

  Button.prototype._onend = function(event) {
    if (this._dragTarget === event.target) {
      this._events.emit('click');
    }
    this._dragTarget = null;
    this._events.emit('pointerup');
  };

  if (typeof module !== 'undefined' && module.exports) {
    module.exports = Button;
  } else {
    app.Button = Button;
  }
})(this.app || (this.app = {}));<commit_msg>Transfer event object of pointer event for button<commit_after>(function(app) {
  'use strict';

  var Draggable = app.Draggable || require('./draggable.js');
  var Events = app.Events || require('../base/events.js');

  var Button = function(el) {
    this.el = el;
    this._events = new Events();
    this._draggable = new Draggable(this.el, {
      onstart: this._onstart.bind(this),
      onmove: function() { /* do nothing */ },
      onend: this._onend.bind(this),
    });
    this._dragTarget = null;
  };

  Button.prototype.init = function() {
    this._draggable.enable();
  };

  Button.prototype.on = function() {
    return Events.prototype.on.apply(this._events, arguments);
  };

  Button.prototype._onstart = function(event) {
    event.preventDefault();
    this._dragTarget = event.target;
    this._events.emit('pointerdown', event);
  };

  Button.prototype._onend = function(event) {
    if (this._dragTarget === event.target) {
      this._events.emit('click');
    }
    this._dragTarget = null;
    this._events.emit('pointerup', event);
  };

  if (typeof module !== 'undefined' && module.exports) {
    module.exports = Button;
  } else {
    app.Button = Button;
  }
})(this.app || (this.app = {}));
{'fraction_non_alphanumeric': 0.17054908485856904, 'fraction_numerical': 0.0, 'mean_word_length': 3.0625, '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': '2190858', 'n_tokens_mistral': 780, 'n_tokens_neox': 767, 'n_words': 143}