summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-08-21 00:20:57 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-08-21 00:20:57 -0500
commit4a4d8608e8a09e0c55f690aeefc05f742bc67011 (patch)
tree014329d6fb42017879c7d1a84aeced120dcd8527
parent18e98a364388e53786c7fe01eaff75efa496bb4c (diff)
downloadgitlab-ce-4a4d8608e8a09e0c55f690aeefc05f742bc67011.tar.gz
Toggle dropdown disabled attribute
Before this the dropdowns were not being disabled if the user unselected an option from the allowed to merge/push dropdowns.
-rw-r--r--app/assets/javascripts/protected_branch_create.js.es64
1 files changed, 1 insertions, 3 deletions
diff --git a/app/assets/javascripts/protected_branch_create.js.es6 b/app/assets/javascripts/protected_branch_create.js.es6
index 2efca2414dc..46beca469b9 100644
--- a/app/assets/javascripts/protected_branch_create.js.es6
+++ b/app/assets/javascripts/protected_branch_create.js.es6
@@ -47,9 +47,7 @@
const $allowedToMergeInput = this.$wrap.find('input[name="protected_branch[merge_access_levels_attributes][0][access_level]"]');
const $allowedToPushInput = this.$wrap.find('input[name="protected_branch[push_access_levels_attributes][0][access_level]"]');
- if ($branchInput.val() && $allowedToMergeInput.val() && $allowedToPushInput.val()){
- this.$form.find('input[type="submit"]').removeAttr('disabled');
- }
+ this.$form.find('input[type="submit"]').attr('disabled', !($branchInput.val() && $allowedToMergeInput.length && $allowedToPushInput.length));
}
}