Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-09-27 00:14:25 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-09-27 00:14:25 +0300
commit4f4060ab4c38c739c985bf8393d25fe785138c8d (patch)
tree23e58e57b9dfc135cf8f1a6d701dcbbb29e80265 /app/assets/javascripts/protected_branches
parentf68b3aaaadac6658f8c2b5c330873582e44b87f8 (diff)
Addressed observations
Diffstat (limited to 'app/assets/javascripts/protected_branches')
-rw-r--r--app/assets/javascripts/protected_branches/protected_branch_create.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/protected_branches/protected_branch_create.js b/app/assets/javascripts/protected_branches/protected_branch_create.js
index 007846d732a..efc612a3dc7 100644
--- a/app/assets/javascripts/protected_branches/protected_branch_create.js
+++ b/app/assets/javascripts/protected_branches/protected_branch_create.js
@@ -50,13 +50,13 @@ export default class ProtectedBranchCreate {
const $branchInput = this.$form.find('input[name="protected_branch[name]"]');
const $allowedToMergeInput = this.$form.find('input[name="protected_branch[merge_access_levels_attributes][0][access_level]"]');
const $allowedToPushInput = this.$form.find('input[name="protected_branch[push_access_levels_attributes][0][access_level]"]');
- const completedForm = !($branchInput.val() && $allowedToMergeInput.length
- && $allowedToPushInput.length);
- // Save previously used settings
- if (!completedForm) {
- this.savePreviousSelection($allowedToMergeInput.val(), $allowedToPushInput.val());
- }
+ const completedForm = !(
+ $branchInput.val() &&
+ $allowedToMergeInput.length &&
+ $allowedToPushInput.length
+ );
+ this.savePreviousSelection($allowedToMergeInput.val(), $allowedToPushInput.val());
this.$form.find('input[type="submit"]').attr('disabled', completedForm);
}