summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-11-17 13:30:06 +0200
committerAlon Levy <alon@pobox.com>2014-11-19 23:21:42 +0200
commita2c1a7b364bc9d1092aaa4af095b495f0da1384f (patch)
tree32ecf746d3bd0bc29d07a6faa419cc5f20115b44 /src
parentcbf03e61c2f052bad71345b7ff8348ad8d4186c2 (diff)
Topo_Diff - for_each_X() convenience functions
Diffstat (limited to 'src')
-rw-r--r--src/model/diff.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/diff.js b/src/model/diff.js
index 1bcfc5a2..ca9c41c9 100644
--- a/src/model/diff.js
+++ b/src/model/diff.js
@@ -35,6 +35,22 @@ define([],
this.node_set_rm = obj_spec.node_set_rm;
this.node_set_add = obj_spec.node_set_add;
this.link_set_add = obj_spec.link_set_add;
+
+ }
+ Topo_Diff.prototype.for_each_node_add = function(callback, this_arg) {
+ this.node_set_add.forEach(callback, this_arg);
+ }
+
+ Topo_Diff.prototype.for_each_node_rm = function(callback, this_arg) {
+ this.node_set_rm.forEach(callback, this_arg);
+ }
+
+ Topo_Diff.prototype.for_each_link_add = function(callback, this_arg) {
+ this.link_set_add.forEach(callback, this_arg);
+ }
+
+ Topo_Diff.prototype.for_each_link_rm = function(callback, this_arg) {
+ this.link_set_rm.forEach(callback, this_arg);
}
/**