diff options
| author | Alon Levy <alon@pobox.com> | 2014-10-06 18:16:29 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-10-07 08:51:43 +0300 |
| commit | ece695b8a51a749095d692e3bfbbd39061f4cb3b (patch) | |
| tree | 1489d5d05991cd9e528a9ae3c0bd0ab391a50bdb | |
| parent | 26b5eeff42c50008b563f368f732965a90a3371b (diff) | |
rhizicore: add hasNode
| -rw-r--r-- | scripts/rhizicore.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js index 34cfddc2..d96e7226 100644 --- a/scripts/rhizicore.js +++ b/scripts/rhizicore.js @@ -313,6 +313,18 @@ function myGraph(el) { } + var hasNode = function(id, state) { + var i; + id = id.toLowerCase(); + for (i = 0 ; i < nodes.length; ++i) { + if (nodes[i].id == id && nodes[i].state == state) { + return true; + } + } + return false; + } + this.hasNode = hasNode; + var findNode = function(id, state) { id = id && id.toLowerCase(); for (var i = 0; i < nodes.length; i++) { |
