Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Widget () {
  2.   this._events = {};
  3.  
  4.   this.on = function(name, callback){
  5.  
  6.     if ( ! $.isFunction(callback) ) return this;
  7.  
  8.     if ( this._events[name] == undefined )
  9.       this._events[name] = [];
  10.  
  11.     this._events[name].push(callback);
  12.  
  13.   }
  14. }
  15.  
  16. var Widget () {
  17.   _events: {},
  18.  
  19.   on: function(name, callback){
  20.  
  21.     if ( ! $.isFunction(callback) ) return this;
  22.  
  23.     if ( this._events[name] == undefined )
  24.       this._events[name] = [];
  25.  
  26.     this._events[name].push(callback);
  27.  
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement