summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-08-03 20:08:57 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-08-05 17:19:01 -0500
commite1d86ec9149a328bf975f55d003b3c29806cadbb (patch)
tree1d14c80f802d942092000a470e0448a414bb1dca /app
parent3b228db1c20ed582c911e3269551fcdfd9f1bde7 (diff)
downloadgitlab-ce-e1d86ec9149a328bf975f55d003b3c29806cadbb.tar.gz
Select first value by default
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/protected_branch_create.js.es613
1 files changed, 11 insertions, 2 deletions
diff --git a/app/assets/javascripts/protected_branch_create.js.es6 b/app/assets/javascripts/protected_branch_create.js.es6
index 0b57964a0eb..44e60e90998 100644
--- a/app/assets/javascripts/protected_branch_create.js.es6
+++ b/app/assets/javascripts/protected_branch_create.js.es6
@@ -6,19 +6,28 @@ class ProtectedBranchCreate {
buildDropdowns() {
// Allowed to Merge dropdowns
+ const $allowedToMergeDropdown = this.$wrap.find('.js-allowed-to-merge');
+ const $allowedToPushDropdown = this.$wrap.find('.js-allowed-to-push');
+
new ProtectedBranchAccessDropdown({
- $dropdown: this.$wrap.find('.js-allowed-to-merge'),
+ $dropdown: $allowedToMergeDropdown,
data: gon.merge_access_levels,
onSelect: this.onSelect.bind(this)
});
+ // Select default
+ $allowedToMergeDropdown.data('glDropdown').selectRowAtIndex(document.createEvent('Event'), 0);
+
// Allowed to Push dropdowns
new ProtectedBranchAccessDropdown({
- $dropdown: this.$wrap.find('.js-allowed-to-push'),
+ $dropdown: $allowedToPushDropdown,
data: gon.push_access_levels,
onSelect: this.onSelect.bind(this)
});
+ // Select default
+ $allowedToPushDropdown.data('glDropdown').selectRowAtIndex(document.createEvent('Event'), 0);
+
new ProtectedBranchDropdowns({
$dropdowns: this.$wrap.find('.js-protected-branch-select'),
onSelect: this.onSelect.bind(this)