Skip to content

Commit

Permalink
Merge branch 'feature/event-binding-return-player'
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed Apr 18, 2012
2 parents 452669e + 2ee7ae0 commit b0061f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Event binders (on/off/one) now return the player instance
* Stopped player from going back to beginningg on ended event.
* Added support for percent width/height and fluid layouts
* Improved load order of elements to reduce reflow.
Expand Down
10 changes: 7 additions & 3 deletions src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,29 @@ _V_.Component = _V_.Class.extend({
/* Events
================================================================================ */
on: function(type, fn, uid){
return _V_.on(this.el, type, _V_.proxy(this, fn));
_V_.on(this.el, type, _V_.proxy(this, fn));
return this;
},
// Deprecated name for 'on' function
addEvent: function(){ return this.on.apply(this, arguments); },

off: function(type, fn){
return _V_.off(this.el, type, fn);
_V_.off(this.el, type, fn);
return this;
},
// Deprecated name for 'off' function
removeEvent: function(){ return this.off.apply(this, arguments); },

trigger: function(type, e){
return _V_.trigger(this.el, type, e);
_V_.trigger(this.el, type, e);
return this;
},
// Deprecated name for 'off' function
triggerEvent: function(){ return this.trigger.apply(this, arguments); },

one: function(type, fn) {
_V_.one(this.el, type, _V_.proxy(this, fn));
return this;
},

/* Ready - Trigger functions when component is ready
Expand Down

0 comments on commit b0061f0

Please sign in to comment.