Commit ccae561f9bf5ff091760a3a0d7fa091e46d38a59
1 parent
69ff7657
Exists in
spb-stable
and in
3 other branches
Fix selectbox when submit MR from fork to origin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
app/controllers/projects/merge_requests_controller.rb
| ... | ... | @@ -152,6 +152,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController |
| 152 | 152 | @target_project = selected_target_project |
| 153 | 153 | @target_branches = @target_project.repository.branch_names |
| 154 | 154 | @target_branches |
| 155 | + | |
| 156 | + respond_to do |format| | |
| 157 | + format.js | |
| 158 | + end | |
| 155 | 159 | end |
| 156 | 160 | |
| 157 | 161 | def ci_status | ... | ... |
app/views/projects/merge_requests/update_branches.js.haml
| 1 | 1 | :plain |
| 2 | 2 | $(".target_branch").html("#{escape_javascript(options_for_select(@target_branches))}"); |
| 3 | - $(".target_branch").trigger("select2:updated"); | |
| 3 | + | |
| 4 | + $('select.target_branch').select2({ | |
| 5 | + width: 'resolve', | |
| 6 | + dropdownAutoWidth: true | |
| 7 | + }); | |
| 8 | + | |
| 4 | 9 | $(".mr_target_commit").html(""); |
| 5 | - $(".target_branch").trigger("change"); | ... | ... |