(js) Fix contact's nickname when composing msg

The nickname is wrapped with <em> tags when viewing the card but those
tags must not appear when composing a new message from one of the
contact's email addresses.
This commit is contained in:
Francis Lachapelle
2016-05-25 11:33:25 -04:00
parent c9346e4f24
commit 9fc22f2689
3 changed files with 5 additions and 5 deletions
@@ -216,14 +216,14 @@
return Card.$$resource.download(this.pid, 'export', {uids: selectedIDs}, {type: 'application/octet-stream'});
};
Card.prototype.$fullname = function() {
var fn = this.c_cn || '', names;
Card.prototype.$fullname = function(options) {
var fn = this.c_cn || '', html = options && options.html, names;
if (fn.length === 0) {
names = [];
if (this.c_givenname && this.c_givenname.length > 0)
names.push(this.c_givenname);
if (this.nickname && this.nickname.length > 0)
names.push('<em>' + this.nickname + '</em>');
names.push((html?'<em>':'') + this.nickname + (html?'</em>':''));
if (this.c_sn && this.c_sn.length > 0)
names.push(this.c_sn);
if (names.length > 0)