diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-11-17 14:46:23 -0800 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-11-17 14:46:23 -0800 |
commit | 2a313eb971ab36e166308f7882897ef204234d0a (patch) | |
tree | 6bb7a72ee7bce1c0baef908af49ff1b817c939f2 /assets/js/components | |
parent | 3b786e05e0e51ca6f85ef9a3ca0d649f3e34c534 (diff) |
Add the possibility to send tasks and comments to multiple recipients
Diffstat (limited to 'assets/js/components')
-rw-r--r-- | assets/js/components/autocomplete-email.js | 14 |
1 files changed, 10 insertions, 4 deletions
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(); |