I have the following attached to a svg element
var dragger = d3.behavior.drag()
.origin(function(d) {
return d;
})
.on('drag', this.move)
.on('dragend', dropHandler);
//caller
var g = c.append('svg').call(dragger).data([{
x: x0,
y: y0
}]);
I am implementing some code inside the dropHandler function that needs it's own implementation of .on("drag",..). How do I remove the previous event handler from the code?
I tried the following:
.unbind()
selection.on("drag",null);