From 6f30dfaab7a3b97d87067af5fdc3c2b390b8e2e9 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 7 Oct 2014 21:43:32 +0300 Subject: Fixes #49: forgot link changes --- scripts/rhizicore.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'scripts/rhizicore.js') 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) { -- cgit v1.3.1