Navigation Menu

Skip to content

Commit

Permalink
(js) Split string when pasting multiple addresses
Browse files Browse the repository at this point in the history
Fixes #4097
  • Loading branch information
cgx committed Mar 22, 2017
1 parent bc8146e commit 5ff8463
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -7,6 +7,7 @@ New features
Enhancements
- [web] constrain event/task reminder to a positive number
- [web] display year in day and week views
- [web] split string on comma and semicolon when pasting multiple addresses (#4097)

Bug fixes
- [core] handle broken CalDAV clients sending bogus SENT-BY (#3992)
Expand Down
10 changes: 7 additions & 3 deletions UI/WebServerResources/js/Mailer/MessageEditorController.js
Expand Up @@ -253,11 +253,15 @@
function addRecipient(contact, field) {
var recipients, recipient, list;

if (angular.isString(contact))
return contact;

recipients = vm.message.editable[field];

if (angular.isString(contact)) {
_.forEach(contact.split(/[,;]/), function(address) {
recipients.push(address);
});
return null;
}

if (contact.$isList({expandable: true})) {
// If the list's members were already fetch, use them
if (angular.isDefined(contact.refs) && contact.refs.length) {
Expand Down

0 comments on commit 5ff8463

Please sign in to comment.