Skip to content
Browse files

fix passing null selector to `on()` or `off()`

fixes #400
  • Loading branch information...
1 parent b8b8900 commit 753e80114f0618bd7ce865508e0ff2085d0bfb5f @mislav mislav committed Apr 13, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/event.js
View
4 src/event.js
@@ -165,11 +165,11 @@
$.fn.on = function(event, selector, callback){
return selector == undefined || $.isFunction(selector) ?
- this.bind(event, selector) : this.delegate(selector, event, callback)
+ this.bind(event, selector || callback) : this.delegate(selector, event, callback)
}
$.fn.off = function(event, selector, callback){
return selector == undefined || $.isFunction(selector) ?
- this.unbind(event, selector) : this.undelegate(selector, event, callback)
+ this.unbind(event, selector || callback) : this.undelegate(selector, event, callback)
}
$.fn.trigger = function(event, data){

0 comments on commit 753e801

Please sign in to comment.
Something went wrong with that request. Please try again.