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

Conversation

Projects
None yet
2 participants
@daffl
Contributor

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

daffl added a commit that referenced this pull request Feb 21, 2013

Merge pull request #279 from bitovi/delegate-clashes-279
Fix can.Observe.delegate variable name problems

@daffl daffl merged commit 6e35cd4 into master Feb 21, 2013

1 check was pending

default The Travis build is in progress
Details

@daffl daffl deleted the delegate-clashes-279 branch Feb 21, 2013

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Feb 21, 2013

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@nchervyakov

nchervyakov Feb 21, 2013

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.

nchervyakov commented Feb 21, 2013

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Feb 21, 2013

Contributor

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

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