(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.pull/210/head
parent
c9346e4f24
commit
9fc22f2689
|
@ -396,7 +396,7 @@
|
|||
ng-click="addressbook.selectCard(currentCard)">
|
||||
<div class="sg-tile-content">
|
||||
<div class="sg-md-subhead">
|
||||
<div ng-bind-html="currentCard.$fullname()"><!-- cn --></div>
|
||||
<div ng-bind-html="currentCard.$fullname({html: true})"><!-- cn --></div>
|
||||
</div>
|
||||
<div class="sg-md-body">
|
||||
<div>{{currentCard.$preferredEmail(addressbook.selectedFolder.constructor.$query.value)}}</div>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<!--list avatar-->
|
||||
</div>
|
||||
<div class="msg-header-content">
|
||||
<h1 class="sg-md-display-2--thin" ng-bind-html="editor.card.$fullname()"><!-- fullname --></h1>
|
||||
<h1 class="sg-md-display-2--thin" ng-bind-html="editor.card.$fullname({html: true})"><!-- fullname --></h1>
|
||||
<h6 class="sg-md-display-2-subheader--thin">{{editor.card.$description()}}</h6>
|
||||
<md-chips ng-model="editor.card.categories"
|
||||
class="sg-readonly" readonly="true">
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue