summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-08-21 00:21:32 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-08-21 00:21:32 -0500
commita7d7e9a51889a276f2d057207fba8d095fa8fc8d (patch)
tree703fb3bd4a4d174856fbb341604994128932ae6f
parent4a4d8608e8a09e0c55f690aeefc05f742bc67011 (diff)
downloadgitlab-ce-fix-empty-dropdown.tar.gz
Set default label if user unselects the option from dropdownfix-empty-dropdown
-rw-r--r--app/assets/javascripts/protected_branch_access_dropdown.js.es68
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/protected_branch_access_dropdown.js.es6 b/app/assets/javascripts/protected_branch_access_dropdown.js.es6
index 2fbb088fa04..7aeb5f92514 100644
--- a/app/assets/javascripts/protected_branch_access_dropdown.js.es6
+++ b/app/assets/javascripts/protected_branch_access_dropdown.js.es6
@@ -10,8 +10,12 @@
selectable: true,
inputId: $dropdown.data('input-id'),
fieldName: $dropdown.data('field-name'),
- toggleLabel(item) {
- return item.text;
+ toggleLabel(item, el) {
+ if (el.is('.is-active')) {
+ return item.text;
+ } else {
+ return 'Select';
+ }
},
clicked(item, $el, e) {
e.preventDefault();