Commit e1d86ec9 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Select first value by default

parent 3b228db1
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment