Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can.Control event delegation problem #279

Merged
merged 1 commit into from
Feb 21, 2013
Merged

can.Control event delegation problem #279

merged 1 commit into from
Feb 21, 2013

Conversation

daffl
Copy link
Contributor

@daffl daffl commented Feb 21, 2013

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 );
    },

Unverified

This user has not yet uploaded their public signing key.
daffl added a commit that referenced this pull request Feb 21, 2013
Fix can.Observe.delegate variable name problems
@daffl daffl merged commit 6e35cd4 into master Feb 21, 2013
@daffl daffl deleted the delegate-clashes-279 branch February 21, 2013 14:25
@daffl
Copy link
Contributor

daffl commented Feb 21, 2013

Thank you. Fixed the name it will be available in the download builder for the next version. Hopefully we'll have the entire builder more reliable with things like that then, too.

@nchervyakov
Copy link
Author

Thanks for fix.
I hope, the next time when I find a bug I will try to make a pull request myself, just need to learn the canjs internals more detailed.

@daffl
Copy link
Contributor

daffl commented Feb 21, 2013

No problem. Any pull request will be appreciated. If you are running into problems just ping us on GitHub or at #canjs in IRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants