diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-21 08:21:32 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-21 08:21:32 +0300 |
commit | a7d7e9a51889a276f2d057207fba8d095fa8fc8d (patch) | |
tree | 703fb3bd4a4d174856fbb341604994128932ae6f /app/assets | |
parent | 4a4d8608e8a09e0c55f690aeefc05f742bc67011 (diff) |
Set default label if user unselects the option from dropdown
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/protected_branch_access_dropdown.js.es6 | 8 |
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(); |