I have a force layout in d3 and I have the following code for an item within my node...
drag = force.drag()
.on("dragstart", dragstart);
...
circle = node.append("circle")
.attr("r", 36)
.on("dblclick", dblclick)
.call(drag);
...
node.on("mousedown", function(d){
if(d == lastNode){
circle.on(".drag", null);
drag_line
.attr("class", "link")
.attr("x1", d.x)
.attr("y1", d.y)
.attr("x2", d.x)
.attr("y2", d.y);
}
else{
lastNode = mousedown_node = d;
}
svg.call(disabledZoom);
})
The problem is that even when I set the drag to null the circle still drags. Can anyone see what I am missing?