diff options
author | Patrick Maia and Victor Shyba <pixelated-team+pmaia+vshyba@thoughtworks.com> | 2014-11-24 18:07:54 -0300 |
---|---|---|
committer | Patrick Maia <pmaia@thoughtworks.com> | 2014-11-24 18:08:24 -0300 |
commit | 42229ae94c50c6b6184f47b072c52994cd3083c1 (patch) | |
tree | de524d91111c62f5fccd273a857c245b82fe80a7 /web-ui/app | |
parent | ed857631616052bc137c6b1d50368bfbf711210d (diff) |
Card #162 - tokenizes multiple recipients entered at once
Diffstat (limited to 'web-ui/app')
-rw-r--r-- | web-ui/app/js/mail_view/ui/recipients/recipients_input.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js index 12c5c340..c1c32d77 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js @@ -99,7 +99,7 @@ define([ }; this.tokenizeRecipient = function (event) { - if (_.isEmpty(this.$node.val())) { + if (_.isEmpty(this.$node.val().trim())) { return; } @@ -109,8 +109,12 @@ define([ this.recipientSelected = function (event, data) { var value = (data && data.value) || this.$node.val(); - - this.trigger(this.$node, events.ui.recipients.entered, { name: this.attr.name, address: value }); + var that = this; + _.each(value.split(/[,;]/), function(address) { + if (!_.isEmpty(address.trim())) { + that.trigger(that.$node, events.ui.recipients.entered, { name: that.attr.name, address: address.trim() }); + } + }); reset(this.$node); }; |