bitovi/canjs — pull request #279 by daffl (2013-02-21 14:24:54+00:00)
Title: can.Control event delegation problem

When I have made custom build of can.js and observable delegation plugin, event delegation broke.
The problem is that variable 'delegate' is used for canControl and for observables. Observables just overwrite the can.Control's delegate.

This fix helped me:

delegate2 = delegate,
bind2 = bind,

// Calls bind or unbind depending if there is a selector.
binder = function( el, ev, callback, selector ) {
return selector ?
delegate2( el, can.trim( selector ), ev, callback ) :
bind2( el, ev, callback );
},