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

Add functionality to unbind events of specific child elements #317

Open
gabrielhpugliese opened this issue Oct 15, 2014 · 4 comments
Open

Comments

@gabrielhpugliese
Copy link

As mentioned here, it would be nice to unbind events of specific child elements inside components, like:

this.on('click', { 
  buttonSelector: this.calculateShippingPrice,
  inputSelector: this.calculateShippingPrice 
});

this.off('buttonSelector', 'click'); // <--- this
@tgvashworth
Copy link
Contributor

To differentiate between delegated and directly bound events, we'll probably need a syntax like this:

this.off('click', { 
  buttonSelector: this.calculateShippingPrice
});

@gabrielhpugliese
Copy link
Author

What if I don't want to call this.calculateShippingPrice. How would the syntax be?

@giuseppeg
Copy link
Contributor

This may be not that straightforward, because all we have is a function (the rules live in its closure).
https://github.com/flightjs/flight/blob/master/lib/utils.js#L235

@tgvashworth
Copy link
Contributor

Yeah, this'll definitely require some redoing of the delegation stuff.

@tgvashworth tgvashworth added this to the 2.0.0 milestone Jan 14, 2015
@tgvashworth tgvashworth removed this from the v2.0.0 milestone Apr 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants