madrobby/zepto — Issue #400: .on event error
Author: lasterra
Created: 2012-02-16 09:42:25+00:00
State: open

There is a issue when the selector is undefined... and the event is bind and not delegated to the element.

I think also that jquery docs says that selector could be null. In zepto, if the selector is null event is delegated... and throws an error.

In uppercase my solution

$.fn.on = function(event, selector, callback){
return selector === undefined || SELECTOR==NULL|| $.isFunction(selector) ?
this.bind(event, CALLBACK) : this.delegate(selector, event, callback);
};