Skip to content
This repository

Removing events in d3.dispatch by name only #880

Closed
tmcw opened this Issue November 06, 2012 · 2 comments

2 participants

Tom MacWright Mike Bostock
Tom MacWright

When attaching several listeners of different types with d3's d3.dispatch, it could be handy to just supply a name to on('.foo', null).

For instance

// add bindings
d3.select('#foo').on('click.foo', function() {}).on('mousedown.foo', function() {}).on('mouseup.foo', function() {});

// remove bindings
d3.select('#foo').on('.foo', null);
Mike Bostock
Owner

Regardless of whether behavior’s get an unbind method, it seems useful to have this functionality as well. In fact, I’d prefer to support this initially, so staging for 3.1.

Jason Davies jasondavies referenced this issue from a commit in jasondavies/d3 March 12, 2013
Jason Davies Adding, retrieving and removing named listeners.
Fixes #880.
827fc38
Jason Davies jasondavies referenced this issue from a commit March 13, 2013
Commit has since been removed from the repository and is no longer available.
Jason Davies jasondavies referenced this issue from a commit in jasondavies/d3 March 12, 2013
Jason Davies Support for {selection,dispatch}.on(".foo", null).
This allows all listeners with a particular name to be removed.

Fixes #880.
9d19250
Mike Bostock
Owner

Staged in #1120.

Mike Bostock mbostock closed this March 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.