summaryrefslogtreecommitdiff
path: root/src/client/view/selection.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-04 01:02:22 +0200
committerAlon Levy <alon@pobox.com>2015-03-04 01:02:22 +0200
commitd21464f4b8063945e7657e71832c1b4c3e5b9e86 (patch)
tree7f3d60e81938af5d5834222c1854ebb96b4047f3 /src/client/view/selection.js
parentb9d14b315671246f181f5dc0c1c47398819761b4 (diff)
client:selection: invert on shift
Diffstat (limited to 'src/client/view/selection.js')
-rw-r--r--src/client/view/selection.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/view/selection.js b/src/client/view/selection.js
index 5e24e801..6ac675aa 100644
--- a/src/client/view/selection.js
+++ b/src/client/view/selection.js
@@ -213,9 +213,9 @@ var inner_update = function(nodes)
connectedComponent(nodes);
}
-var update = function(nodes, append)
+var update = function(nodes)
{
- var new_nodes = append ? _.union(root_nodes, nodes) : nodes;
+ var new_nodes = nodes;
var not_same = !arr_compare(new_nodes, root_nodes);
if (not_same) {
@@ -223,6 +223,11 @@ var update = function(nodes, append)
}
}
+var invert = function(nodes)
+{
+ update(_.union(_.difference(root_nodes, nodes), _.difference(nodes, root_nodes)));
+}
+
var setup_toolbar = function(main_graph)
{
var merge_root_selection = function() {
@@ -263,6 +268,7 @@ return {
byVisitors: byVisitors,
connectedComponent: connectedComponent,
clear: clear,
+ invert: invert,
update: update,
selected_class__node: selected_class__node,
selected_class__link: selected_class__link,