From 2a313eb971ab36e166308f7882897ef204234d0a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 17 Nov 2017 14:46:23 -0800 Subject: Add the possibility to send tasks and comments to multiple recipients --- assets/js/components/autocomplete-email.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'assets/js/components') diff --git a/assets/js/components/autocomplete-email.js b/assets/js/components/autocomplete-email.js index 9d337e03..8e46e1d3 100644 --- a/assets/js/components/autocomplete-email.js +++ b/assets/js/components/autocomplete-email.js @@ -1,9 +1,15 @@ KB.onClick('.js-autocomplete-email', function (e) { - var email = KB.dom(e.target).data('email'); - var emailField = KB.find('.js-mail-form input[type="email"]'); + var email = e.target.dataset.email; + var emailField = document.querySelector('.js-mail-form input[name="emails"]'); - if (email && emailField) { - emailField.build().value = email; + if (!email || !emailField) { + return; + } + + if (emailField.value !== '') { + emailField.value += ', ' + email; + } else { + emailField.value = email; } _KB.controllers.Dropdown.close(); -- cgit v1.2.3