hide cc field if empty

This commit is contained in:
yuri
2015-04-01 12:23:00 +03:00
parent 878e1616da
commit 6e50e4fd8e
@@ -57,6 +57,14 @@ Espo.define('Views.Email.Record.Detail', 'Views.Record.Detail', function (Dep) {
}
},
handleCcField: function () {
if (!this.model.get('cc')) {
this.hideField('cc');
} else {
this.showField('cc');
}
},
afterRender: function () {
Dep.prototype.afterRender.call(this);
@@ -64,6 +72,10 @@ Espo.define('Views.Email.Record.Detail', 'Views.Record.Detail', function (Dep) {
this.listenTo(this.model, 'change:attachmentsIds', function () {
this.handleAttachmentField();
}, this);
this.handleCcField();
this.listenTo(this.model, 'change:cc', function () {
this.handleCcField();
}, this);
},
send: function () {