Changed the data for New Tag to a script block

This commit is contained in:
Tim Zallmann 2017-07-25 11:45:08 +02:00
parent 24d9142cab
commit 395e34bd0f
2 changed files with 2 additions and 6 deletions

View File

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

View File

@ -40,8 +40,4 @@
.form-actions
= button_tag 'Create tag', class: 'btn btn-create', tabindex: 3
= link_to 'Cancel', project_tags_path(@project), class: 'btn btn-cancel'
-# haml-lint:disable InlineJavaScript
:javascript
window.gl = window.gl || { };
window.gl.availableRefs = #{@project.repository.ref_names.to_json};
%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe