summaryrefslogtreecommitdiff
path: root/src/client/view/selection.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-01-21 14:51:21 +0200
committerAlon Levy <alon@pobox.com>2015-01-21 14:52:10 +0200
commitde731590ada4db90749a01b61b81774b91867696 (patch)
tree614650d9c36a870997db2df43a94ce9d7fb3d3f5 /src/client/view/selection.js
parent37580fcafdc94c55e880a989dc7103e97ed9edd2 (diff)
Fixes #294 - make selection ignore temporary nodes (bad implementation)
Should have two functions for node+link class setting, one for temporary, one for not, instead of passing this constant (since construction time) value along.
Diffstat (limited to 'src/client/view/selection.js')
-rw-r--r--src/client/view/selection.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/view/selection.js b/src/client/view/selection.js
index 090b1a5f..65c318e1 100644
--- a/src/client/view/selection.js
+++ b/src/client/view/selection.js
@@ -116,12 +116,12 @@ var link_selected = function(link) {
return node_selected(link.__src) && node_selected(link.__dst);
}
-var selected_class__node = function(node) {
- return selected_nodes.length > 0 ? (node_selected(node) ? "selected" : "notselected") : "";
+var selected_class__node = function(node, temporary) {
+ return !temporary && selected_nodes.length > 0 ? (node_selected(node) ? "selected" : "notselected") : "";
}
-var selected_class__link = function(link) {
- return selected_nodes.length > 0 ? (link_selected(link) ? "selected" : "notselected") : "";
+var selected_class__link = function(link, temporary) {
+ return !temporary && selected_nodes.length > 0 ? (link_selected(link) ? "selected" : "notselected") : "";
}
var clear = function() {