diff options
| author | Owen <despito@MacBook-Pro-de-Despito.local> | 2014-08-13 17:28:51 +0300 |
|---|---|---|
| committer | Owen <despito@MacBook-Pro-de-Despito.local> | 2014-08-13 17:28:51 +0300 |
| commit | d811721e5ca0f56717fa08a9f7f60abdef12a593 (patch) | |
| tree | aa2177b691b51597002461df2832c97384ee3bc7 /scripts/rhizicore.js | |
| parent | 50abd6a9f295d349b447535edc0a147f690b042d (diff) | |
Stop duplicate links
Diffstat (limited to 'scripts/rhizicore.js')
| -rw-r--r-- | scripts/rhizicore.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js index 978433aa..27f4d25b 100644 --- a/scripts/rhizicore.js +++ b/scripts/rhizicore.js @@ -152,8 +152,12 @@ function myGraph(el) { this.addLink = function(sourceId, targetId, name, state) { var sourceNode = findNode(sourceId, null); var targetNode = findNode(targetId, null); + var found=findLink(sourceId,targetId,name); + if(name)if(name.replace(/ /g,"")==="and")state="temp"; - if ((sourceNode !== undefined) && (targetNode !== undefined)) { + if(found){ + + }else if ((sourceNode !== undefined) && (targetNode !== undefined)) { links.push({ "source": sourceNode, "target": targetNode, |
