diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-28 11:07:57 +0200 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-28 11:07:57 +0200 |
commit | 08a241d606633fa2b2c7c32c84b3d846dece035b (patch) | |
tree | c41d30079c6ccdcec8e6d4c574dde374ce65bab2 | |
parent | 8663b63af34f7b79930ad94c39e128c4c28e2a1d (diff) | |
download | gitlab-ce-08a241d606633fa2b2c7c32c84b3d846dece035b.tar.gz |
Moved the duplicate Available Refs to a default in RefSelectDropdowninline-js-removal-projects-other
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/ref_select_dropdown.js | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index bb15b14bb98..29dcd460e93 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -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': diff --git a/app/assets/javascripts/ref_select_dropdown.js b/app/assets/javascripts/ref_select_dropdown.js index 215cd6fbdfd..65e4101352c 100644 --- a/app/assets/javascripts/ref_select_dropdown.js +++ b/app/assets/javascripts/ref_select_dropdown.js @@ -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, |