summaryrefslogtreecommitdiff
path: root/src/client/model/graph.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-16 12:48:11 +0200
committerAlon Levy <alon@pobox.com>2015-03-16 12:59:38 +0200
commitb39381f3248849612d2f6067ce9fbf14bb92652b (patch)
tree8877fb18928d61d9ab7546640eab36a9386eedc9 /src/client/model/graph.js
parent4a4e87691cd1deb50c7570c3984f60f91272e587 (diff)
client: use 'untitled' as empty link fixes #381
Sanitizes any link attribute change. Topo diff in next patch since I might want to reverse it - current interface doesn't allow introducing null link names on creation.
Diffstat (limited to 'src/client/model/graph.js')
-rw-r--r--src/client/model/graph.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/model/graph.js b/src/client/model/graph.js
index f8783127..7056cac6 100644
--- a/src/client/model/graph.js
+++ b/src/client/model/graph.js
@@ -380,7 +380,7 @@ function Graph(spec) {
if (!rz_config.backend_enabled) return;
var attr_diff = model_diff.new_attr_diff();
- for (var key in new_link_spec){
+ for (var key in new_link_spec) {
attr_diff.add_link_attr_write(link.id, key, new_link_spec[key]);
}
@@ -554,7 +554,7 @@ function Graph(spec) {
src_node = find_node__by_id(src_id),
added_links = node_ids.slice(1).map(function (tgt_id) {
return model_core.create_link__set_random_id(src_node, find_node__by_id(tgt_id),
- {name: 'link'});
+ {name: consts.EMPTY_LINK_NAME});
});
commit_and_tx_diff__topo(model_diff.new_topo_diff({link_set_add: added_links}));
};