demos/Collage/fabric.js
function(eventName, handler) {
    if (!this.__eventListeners) {
      this.__eventListeners = { };
    }
    // one object with key/value pairs was passed
    if (arguments.length === 1) {
      for (var prop in eventName) {
        this.on(prop, eventName[prop]);
      }
    }
    else {
      if (!this.__eventListeners[eventName]) {
        this.__eventListeners[eventName] = [ ];
      }
      this.__eventListeners[eventName].push(handler);
    }
  }
function(eventName, handler) {
    if (!this.__eventListeners) {
      this.__eventListeners = { };
    }
    // one object with key/value pairs was passed
    if (arguments.length === 1) {
      for (var prop in eventName) {
        this.on(prop, eventName[prop]);
      }
    }
    else {
      if (!this.__eventListeners[eventName]) {
        this.__eventListeners[eventName] = [ ];
      }
      this.__eventListeners[eventName].push(handler);
    }
  }
function ( eventName , handler ) { if ( ! this . __eventListeners ) { this . __eventListeners = { } ; } // one object with key/value pairs was passed if ( arguments . length === 1 ) { for ( var prop in eventName ) { this . on ( prop , eventName [ prop ] ) ; } } else { if ( ! this . __eventListeners [ eventName ] ) { this . __eventListeners [ eventName ] = [ ] ; } this . __eventListeners [ eventName ] . push ( handler ) ; } }
Observes specified event
@method observe
@depracated Since 0.8.34. Use `on` instead.
@param {String} eventName
@param {Function} handler
Observes specified event