From a2c1a7b364bc9d1092aaa4af095b495f0da1384f Mon Sep 17 00:00:00 2001 From: LV-426 Date: Mon, 17 Nov 2014 13:30:06 +0200 Subject: Topo_Diff - for_each_X() convenience functions --- src/model/diff.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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); } /** -- cgit v1.3.1