summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mixins/with_mail_edit_base.js
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-08 16:56:11 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-08 16:56:11 +0200
commitf33b22f65a88410a75061f3e8e6d509296f4d69f (patch)
tree4b1c7d4d7c86bf927b3c4fef812667a1d71347b9 /web-ui/app/js/mixins/with_mail_edit_base.js
parent84a1e49bdef02ca46df79b7d9151cdf57a574938 (diff)
#97 - making sure that the send button gets enabled when sending drafts even if recipients are undefined for one recipient type but not the others
Diffstat (limited to 'web-ui/app/js/mixins/with_mail_edit_base.js')
-rw-r--r--web-ui/app/js/mixins/with_mail_edit_base.js11
1 files changed, 8 insertions, 3 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 181af736..fe73c03c 100644
--- a/web-ui/app/js/mixins/with_mail_edit_base.js
+++ b/web-ui/app/js/mixins/with_mail_edit_base.js
@@ -59,12 +59,17 @@ define(
};
function thereAreRecipientsToDisplay() {
- return this.attr.recipientValues.to &&
- this.attr.recipientValues.cc &&
- !_.isEmpty(this.attr.recipientValues.to.concat(this.attr.recipientValues.cc));
+ var allRecipients = _.chain(this.attr.recipientValues).
+ values().
+ flatten().
+ remove(undefined).
+ value();
+
+ return !_.isEmpty(allRecipients);
}
this.render = function(template, context) {
+ debugger;
this.$node.html(template(context));
if(!context || _.isEmpty(context)){