From 5ff8463fba9e907b38ef170498395f8f2dc0ee57 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 22 Mar 2017 11:58:05 -0400 Subject: [PATCH] (js) Split string when pasting multiple addresses Fixes #4097 --- NEWS | 1 + .../js/Mailer/MessageEditorController.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 1cc52f885a..7476e7b719 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/UI/WebServerResources/js/Mailer/MessageEditorController.js b/UI/WebServerResources/js/Mailer/MessageEditorController.js index b5e7190e0c..c3941a3f4b 100644 --- a/UI/WebServerResources/js/Mailer/MessageEditorController.js +++ b/UI/WebServerResources/js/Mailer/MessageEditorController.js @@ -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) {