joycss/lib/common/stdclass.js
function on(ev, fn, context){
    var arg = arguments;
    var slice = [].slice;
    var evs = ev.split(',');
    var i = 0;
    var evt = '';
    var __fn = fn;
    fn = function wrapOn(e){
      context = context || this;
      __fn.apply(context, [e].concat(slice.call(arg, 3)));
    };

    while(evs[i]){
      evt = evs[i].replace(TRIM_REG, '');
      if (evt) Events.prototype.on.call(this, evt, fn);
      i++;
    }

    return fn;
  }
function on(ev, fn, context){
    var arg = arguments;
    var slice = [].slice;
    var evs = ev.split(',');
    var i = 0;
    var evt = '';
    var __fn = fn;
    fn = function wrapOn(e){
      context = context || this;
      __fn.apply(context, [e].concat(slice.call(arg, 3)));
    };

    while(evs[i]){
      evt = evs[i].replace(TRIM_REG, '');
      if (evt) Events.prototype.on.call(this, evt, fn);
      i++;
    }

    return fn;
  }
function on ( ev , fn , context ) { var arg = arguments ; var slice = [ ] . slice ; var evs = ev . split ( ',' ) ; var i = 0 ; var evt = '' ; var __fn = fn ; fn = function wrapOn ( e ) { context = context || this ; __fn . apply ( context , [ e ] . concat ( slice . call ( arg , 3 ) ) ) ; } ; while ( evs [ i ] ) { evt = evs [ i ] . replace ( TRIM_REG , '' ) ; if ( evt ) Events . prototype . on . call ( this , evt , fn ) ; i ++ ; } return fn ; }
the same to function on, bind event on self, the only
change is add the ability of bind mult event
@example this.on('a, b, c', fn);
@note the dismember is ', ', do not lost the blank space
@param ev {string} event string, dismember by ', ',semicolon add an
blank space
@param fn {function} function executed when the event is emit
@return fn {function} the callback function would be change, so you should
get the handle of the callback function by the return value
the same to function on bind event on self the only change is add the ability of bind mult event