diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-21 08:19:22 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-21 08:19:22 +0300 |
commit | 18e98a364388e53786c7fe01eaff75efa496bb4c (patch) | |
tree | 8fd54eb6a34a4805a9f625174d3e31ad954eb979 /app/assets | |
parent | 54412dac15203b9208ca3ab56617262e7968050b (diff) |
Do not update if one dropdown has not selected any option
No need to update the branch permission if no option is marked on the dropdown
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/protected_branch_edit.js.es6 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/protected_branch_edit.js.es6 b/app/assets/javascripts/protected_branch_edit.js.es6 index a59fcbfa082..40bc4adb71b 100644 --- a/app/assets/javascripts/protected_branch_edit.js.es6 +++ b/app/assets/javascripts/protected_branch_edit.js.es6 @@ -31,6 +31,9 @@ const $allowedToMergeInput = this.$wrap.find(`input[name="${this.$allowedToMergeDropdown.data('fieldName')}"]`); const $allowedToPushInput = this.$wrap.find(`input[name="${this.$allowedToPushDropdown.data('fieldName')}"]`); + // Do not update if one dropdown has not selected any option + if (!($allowedToMergeInput.length && $allowedToPushInput.length)) return; + $.ajax({ type: 'POST', url: this.$wrap.data('url'), |