summaryrefslogtreecommitdiff
path: root/src/client/model/diff.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/diff.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/diff.js')
-rw-r--r--src/client/model/diff.js7
1 files changed, 5 insertions, 2 deletions
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);
}