Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Removing events in d3.dispatch by name only #880

Closed
tmcw opened this Issue · 2 comments

2 participants

@tmcw

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);
@mbostock
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.

@jasondavies jasondavies referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@jasondavies jasondavies referenced this issue from a commit
@jasondavies jasondavies Support for {selection,dispatch}.on(".foo", null).
This allows all listeners with a particular name to be removed.

Fixes #880.
9d19250
@mbostock
Owner

Staged in #1120.

@mbostock mbostock closed this
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.