From b39381f3248849612d2f6067ce9fbf14bb92652b Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 16 Mar 2015 12:48:11 +0200 Subject: 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. --- src/client/model/diff.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/model/diff.js') diff --git a/src/client/model/diff.js b/src/client/model/diff.js index fa5fe9e1..36f62ddb 100644 --- a/src/client/model/diff.js +++ b/src/client/model/diff.js @@ -3,8 +3,8 @@ /** * Diff module */ -define([], - function() { +define(['consts'], + function(consts) { /** * A set of diff objects @@ -114,6 +114,9 @@ define([], Attr_Diff.prototype.add_link_attr_write = function(l_id, attr_name, attr_val) { + if ('name' === attr_name && String(attr_val).length === 0) { + attr_val = consts.EMPTY_LINK_NAME; + } if (undefined == this.__type_link[l_id]) { this.init_attr_diff_link(l_id); } -- cgit v1.3.1