diff options
| author | Alon Levy <alon@pobox.com> | 2014-11-29 22:24:09 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-11-29 22:33:44 +0200 |
| commit | 897dd1f5bcde6e78999ab8c3834464ebf56db2e5 (patch) | |
| tree | be3e503d69cc3bf5ab1767362f1024261851b90c | |
| parent | ad597c32e28b99ba07e35218f44e5090ab1808ac (diff) | |
model/graph: fix signal on notify
| -rw-r--r-- | src/model/graph.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/model/graph.js b/src/model/graph.js index b7fd85a6..9123b669 100644 --- a/src/model/graph.js +++ b/src/model/graph.js @@ -29,7 +29,8 @@ function Graph() { */ this.__addNode = function(spec, notify) { var existing_node, - node; + node, + notify = undefined === notify ? true : notify; if (undefined == spec.id) { existing_node = findNodeByName(spec.name) @@ -55,11 +56,9 @@ function Graph() { return existing_node; } - undefined === notify && (notify = true); // notify by default - nodes.push(node); - if (undefined == notify){ + if (notify) { signal.signal(consts.APPLIED_GRAPH_DIFF, [{nodes: {add: [node]}}]); } |
