Commit fe728e52 authored by bgeron's avatar bgeron Committed by Commit bot

[turbolizer] Fix a latent bug when dragging a node under another node.

BUG=
R=danno

Review-Url: https://codereview.chromium.org/2169023002
Cr-Commit-Position: refs/heads/master@{#38004}
parent 7ef24ad9
...@@ -469,21 +469,6 @@ class GraphView extends View { ...@@ -469,21 +469,6 @@ class GraphView extends View {
if (!mouseDownNode) return; if (!mouseDownNode) return;
if (mouseDownNode !== d){
// we're in a different node: create new edge for mousedown edge and add to graph
var newEdge = {source: mouseDownNode, target: d};
var filtRes = graph.visibleEdges.filter(function(d){
if (d.source === newEdge.target && d.target === newEdge.source){
graph.edges.splice(graph.edges.indexOf(d), 1);
}
return d.source === newEdge.source && d.target === newEdge.target;
});
if (!filtRes[0].length){
graph.edges.push(newEdge);
graph.updateGraphVisibility();
}
} else{
// we're in the same node
if (state.justDragged) { if (state.justDragged) {
// dragged, not clicked // dragged, not clicked
state.justDragged = false; state.justDragged = false;
...@@ -497,7 +482,6 @@ class GraphView extends View { ...@@ -497,7 +482,6 @@ class GraphView extends View {
selection.select(d3node[0][0], true); selection.select(d3node[0][0], true);
} }
} }
}
selectSourcePositions(start, end, selected) { selectSourcePositions(start, end, selected) {
var graph = this; var graph = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment