src/util/events.js
function (evtStr, handler) {
    if (!this.eventListeners) {
      this.eventListeners = {};
    }
    var events = (evtStr || '').split(' '), len = events.length, n, t, event, parts, baseEvent, name;
    if (!evtStr) {
      // remove all events
      for (t in this.eventListeners) {
        this._off(t, null, handler);
      }
    }
    for (n = 0; n < len; n++) {
      event = events[n];
      parts = event.split('.');
      baseEvent = parts[0];
      name = parts[1];
      if (baseEvent) {
        if (this.eventListeners[baseEvent]) {
          this._off(baseEvent, name, handler);
        }
      } else {
        for (t in this.eventListeners) {
          this._off(t, name, handler);
        }
      }
    }
    return this;
  }
function (evtStr, handler) {
    if (!this.eventListeners) {
      this.eventListeners = {};
    }
    var events = (evtStr || '').split(' '), len = events.length, n, t, event, parts, baseEvent, name;
    if (!evtStr) {
      // remove all events
      for (t in this.eventListeners) {
        this._off(t, null, handler);
      }
    }
    for (n = 0; n < len; n++) {
      event = events[n];
      parts = event.split('.');
      baseEvent = parts[0];
      name = parts[1];
      if (baseEvent) {
        if (this.eventListeners[baseEvent]) {
          this._off(baseEvent, name, handler);
        }
      } else {
        for (t in this.eventListeners) {
          this._off(t, name, handler);
        }
      }
    }
    return this;
  }
function ( evtStr , handler ) { if ( ! this . eventListeners ) { this . eventListeners = { } ; } var events = ( evtStr || '' ) . split ( ' ' ) , len = events . length , n , t , event , parts , baseEvent , name ; if ( ! evtStr ) { // remove all events for ( t in this . eventListeners ) { this . _off ( t , null , handler ) ; } } for ( n = 0 ; n < len ; n ++ ) { event = events [ n ] ; parts = event . split ( '.' ) ; baseEvent = parts [ 0 ] ; name = parts [ 1 ] ; if ( baseEvent ) { if ( this . eventListeners [ baseEvent ] ) { this . _off ( baseEvent , name , handler ) ; } } else { for ( t in this . eventListeners ) { this . _off ( t , name , handler ) ; } } } return this ; }
Remove event bindings. Pass in a string of event types delimmited by a
space to remove multiple event bindings at once such as 'mousedown
mouseup mousemove'. include a namespace to remove an event binding by
name such as 'click.foobar'. If you only give a name like '.foobar', all
events in that namespace will be removed.

@param {String}
evtStr e.g. 'click', 'mousedown.foo touchstart', '.foobar'
Remove event bindings . Pass in a string of event types delimmited by a space to remove multiple event bindings at once such as mousedown mouseup mousemove . include a namespace to remove an event binding by name such as click . foobar . If you only give a name like . foobar all events in that namespace will be removed .