diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app.js | 1 | ||||
| -rw-r--r-- | src/client/view/graph_view.js | 6 | ||||
| -rw-r--r-- | src/client/view/selection.js | 13 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/client/app.js b/src/client/app.js index b0485090..3c5d4328 100644 --- a/src/client/app.js +++ b/src/client/app.js @@ -14,6 +14,7 @@ 'jquery-ui': lib_path + 'jquery-ui', socketio: lib_path + 'socket.io/socket.io.min_0.9.10', html2canvas: lib_path + 'html2canvas', + underscore: lib_path + 'underscore', feedback: lib_path + 'feedback', } } diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js index 205ba0fe..abe95d7b 100644 --- a/src/client/view/graph_view.js +++ b/src/client/view/graph_view.js @@ -320,7 +320,7 @@ function GraphView(spec) { graph.links_rm([that.link]); }); view.edge_info.show(d); - selection.update([src, dst]); + selection.update([src, dst], d3.event.ctrlKey); }); link.attr("class", function(d, i){ @@ -453,7 +453,7 @@ function GraphView(spec) { } if (!temporary) { svgInput.enable(this, d, nodeTextX(d)); - selection.update([d]); + selection.update([d], d3.event.ctrlKey); showNodeInfo(graph.find_node__by_id(this.parentNode.id)); } d3.event.stopPropagation(); @@ -516,7 +516,7 @@ function GraphView(spec) { return; } d3.event.stopPropagation(); - selection.update([d]); + selection.update([d], d3.event.ctrlKey); if(!temporary) { showNodeInfo(d); } diff --git a/src/client/view/selection.js b/src/client/view/selection.js index 7cade769..f5d4c895 100644 --- a/src/client/view/selection.js +++ b/src/client/view/selection.js @@ -1,5 +1,5 @@ -define(['rz_core', 'Bacon'], -function(rz_core, Bacon) { +define(['rz_core', 'Bacon', 'underscore'], +function(rz_core, Bacon, _) { function get_main_graph() { @@ -149,11 +149,12 @@ var inner_update = function(nodes) connectedComponent(nodes); } -var update = function(nodes) { - var set = !arr_compare(nodes, root_nodes); +var update = function(nodes, append) { + var new_nodes = append ? _.union(root_nodes, nodes) : nodes; + var not_same = !arr_compare(new_nodes, root_nodes); - if (set) { - inner_update(nodes); + if (not_same) { + inner_update(new_nodes); } } |
