summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-18 07:41:14 +0000
committerPhil Hughes <me@iamphill.com>2017-05-18 07:41:14 +0000
commita49337727be1e28c29ad19b310fa2eb2df828c91 (patch)
tree22ce367b8e4f13885d5e8b0d679c9dfe487d9bfe /app
parent3bbf9575112a0829f9926d04baea53705a7ba4b5 (diff)
parentfbe1e00e8202c3dfccb45db6e4ce96f8dc0895e7 (diff)
downloadgitlab-ce-a49337727be1e28c29ad19b310fa2eb2df828c91.tar.gz
Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'
Automatically close user dropdown for CE Closes #31987 See merge request !11189
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/users_select.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js
index 1724ca86b61..aea3592c6ba 100644
--- a/app/assets/javascripts/users_select.js
+++ b/app/assets/javascripts/users_select.js
@@ -421,6 +421,15 @@ function UsersSelect(currentUser, els) {
selected = $dropdown.closest('.selectbox').find("input[name='" + ($dropdown.data('field-name')) + "']").val();
return assignTo(selected);
}
+
+ // Automatically close dropdown after assignee is selected
+ // since CE has no multiple assignees
+ // EE does not have a max-select
+ if ($dropdown.data('max-select') &&
+ getSelected().length === $dropdown.data('max-select')) {
+ // Close the dropdown
+ $dropdown.dropdown('toggle');
+ }
},
id: function (user) {
return user.id;