summaryrefslogtreecommitdiff
path: root/scripts/rhizicore.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-07 21:43:32 +0300
committerAlon Levy <alon@pobox.com>2014-10-07 21:43:32 +0300
commit6f30dfaab7a3b97d87067af5fdc3c2b390b8e2e9 (patch)
treec5a3dbd6e6c71d12116392d15c39d1fe50b8b5a2 /scripts/rhizicore.js
parentfc7ecac8c22e79f669b2e4ff28f32641102ebfd3 (diff)
Fixes #49: forgot link changes
Diffstat (limited to 'scripts/rhizicore.js')
-rw-r--r--scripts/rhizicore.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js
index 8ba19bc2..7e107697 100644
--- a/scripts/rhizicore.js
+++ b/scripts/rhizicore.js
@@ -226,7 +226,10 @@ function myGraph(el) {
if (drop_conjugator_links && name && (name.replace(/ /g,"") === "and")) {
state = "temp";
}
- if(!found && ((sourceNode !== undefined) && (targetNode !== undefined))) {
+ if (sourceNode === undefined || targetNode === undefined) {
+ return;
+ }
+ if (!found) {
var link = {
"source": sourceNode,
"target": targetNode,
@@ -237,15 +240,20 @@ function myGraph(el) {
if (this.history !== undefined) {
this.history.record_links([link]);
}
+ } else {
+ found.name = name;
+ found.state = state;
}
}
- this.editLink = function(sourceId, targetId, newname) {
+ this.editLink = function(sourceId, targetId, newname, newstate) {
var link = findLink(sourceId, targetId, newname);
if (link !== undefined) {
link.name = newname;
-
- } else {}
+ if (newstate !== undefined) {
+ link.state = newstate;
+ }
+ }
}
this.editLinkTarget = function(sourceId, targetId, newTarget) {