summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-09-22 10:36:37 -0300
committerDuda Dornelles <ddornell@thoughtworks.com>2014-09-22 10:36:37 -0300
commit1c899a23a9850271da32d4ea02f10fcaf41bd4b2 (patch)
tree34774f306613ba8068e6854f68a47c9022316b1d /web-ui
parenteb59c286605147442ae54005dc59812f4b086662 (diff)
showing draft even if json has no recipients
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/mixins/with_mail_edit_base.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/web-ui/app/js/mixins/with_mail_edit_base.js b/web-ui/app/js/mixins/with_mail_edit_base.js
index 4710cb74..2882758c 100644
--- a/web-ui/app/js/mixins/with_mail_edit_base.js
+++ b/web-ui/app/js/mixins/with_mail_edit_base.js
@@ -58,6 +58,12 @@ define(
Recipients.attachTo(this.select('bccArea'), { name: 'bcc', addresses: context.recipients.bcc || []});
};
+ function thereAreRecipientsToDisplay() {
+ return this.attr.recipientValues.to
+ && this.attr.recipientValues.cc
+ && !_.isEmpty(this.attr.recipientValues.to.concat(this.attr.recipientValues.cc));
+ }
+
this.render = function(template, context) {
this.$node.html(template(context));
@@ -71,7 +77,7 @@ define(
this.on(this.select('trashButton'), 'click', this.trashMail);
SendButton.attachTo(this.select('sendButton'));
- if (!_.isEmpty(this.attr.recipientValues.to.concat(this.attr.recipientValues.cc))) {
+ if (thereAreRecipientsToDisplay.call(this)) {
this.trigger(document, events.ui.sendbutton.enable);
}
};
@@ -190,7 +196,6 @@ define(
this.on(document, events.ui.mail.send, this.sendMail);
this.on(document, events.ui.tag.selected, this.saveTag);
-
});
}