Commit 08a241d6 authored by Tim Zallmann's avatar Tim Zallmann

Moved the duplicate Available Refs to a default in RefSelectDropdown

parent 8663b63a
...@@ -251,7 +251,7 @@ import PerformanceBar from './performance_bar'; ...@@ -251,7 +251,7 @@ import PerformanceBar from './performance_bar';
case 'projects:tags:new': case 'projects:tags:new':
new ZenMode(); new ZenMode();
new gl.GLForm($('.tag-form'), true); new gl.GLForm($('.tag-form'), true);
new RefSelectDropdown($('.js-branch-select'), JSON.parse(document.getElementById('availableRefs').innerHTML)); new RefSelectDropdown($('.js-branch-select'));
break; break;
case 'projects:snippets:new': case 'projects:snippets:new':
case 'projects:snippets:edit': case 'projects:snippets:edit':
...@@ -318,7 +318,7 @@ import PerformanceBar from './performance_bar'; ...@@ -318,7 +318,7 @@ import PerformanceBar from './performance_bar';
setupProjectEdit(); setupProjectEdit();
break; break;
case 'projects:pipelines:new': case 'projects:pipelines:new':
new NewBranchForm($('.js-new-pipeline-form'), JSON.parse(document.getElementById('availableRefs').innerHTML)); new NewBranchForm($('.js-new-pipeline-form'));
break; break;
case 'projects:pipelines:builds': case 'projects:pipelines:builds':
case 'projects:pipelines:failures': case 'projects:pipelines:failures':
......
class RefSelectDropdown { class RefSelectDropdown {
constructor($dropdownButton, availableRefs) { constructor($dropdownButton, availableRefs) {
const availableRefsValue = availableRefs || JSON.parse(document.getElementById('availableRefs').innerHTML);
$dropdownButton.glDropdown({ $dropdownButton.glDropdown({
data: availableRefs, data: availableRefsValue,
filterable: true, filterable: true,
filterByText: true, filterByText: true,
remote: false, remote: false,
......
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