From 96eb2efd8605d41264e5c843b8c8ea22f54f9d5c Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 21 Jan 2015 16:16:48 +0200 Subject: client/model/diff: add two helpers on Attr_Diff --- src/client/model/diff.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/client/model/diff.js b/src/client/model/diff.js index 5835f5d6..211c9ac1 100644 --- a/src/client/model/diff.js +++ b/src/client/model/diff.js @@ -149,6 +149,20 @@ define([], } } + /** + * @param id of node to check for inclusion of + */ + Attr_Diff.prototype.has_node_id_attr_write = function(n_id, attr) { + return this.__type_node[n_id] !== undefined && this.__type_node[n_id].__attr_write[attr]; + } + + /** + * @param id of link to check for inclusion of + */ + Attr_Diff.prototype.has_link_id_attr_write = function(n_id, attr) { + return this.__type_link[n_id] !== undefined && this.__type_link[n_id].__attr_write[attr]; + } + /** * Visual diff object expressing any visual change to the state of a * particular visualization type. -- cgit v1.3.1