Moved the duplicate Available Refs to a default in RefSelectDropdown

This commit is contained in:
Tim Zallmann
2017-07-28 11:07:57 +02:00
parent 8663b63af3
commit 08a241d606
2 changed files with 4 additions and 3 deletions

View File

@ -251,7 +251,7 @@ import PerformanceBar from './performance_bar';
case 'projects:tags:new':
new ZenMode();
new gl.GLForm($('.tag-form'), true);
new RefSelectDropdown($('.js-branch-select'), JSON.parse(document.getElementById('availableRefs').innerHTML));
new RefSelectDropdown($('.js-branch-select'));
break;
case 'projects:snippets:new':
case 'projects:snippets:edit':
@ -318,7 +318,7 @@ import PerformanceBar from './performance_bar';
setupProjectEdit();
break;
case 'projects:pipelines:new':
new NewBranchForm($('.js-new-pipeline-form'), JSON.parse(document.getElementById('availableRefs').innerHTML));
new NewBranchForm($('.js-new-pipeline-form'));
break;
case 'projects:pipelines:builds':
case 'projects:pipelines:failures':

View File

@ -1,7 +1,8 @@
class RefSelectDropdown {
constructor($dropdownButton, availableRefs) {
const availableRefsValue = availableRefs || JSON.parse(document.getElementById('availableRefs').innerHTML);
$dropdownButton.glDropdown({
data: availableRefs,
data: availableRefsValue,
filterable: true,
filterByText: true,
remote: false,