|
|
@ -111,10 +111,15 @@ function initEditForm() { |
|
|
|
function initBranchSelector() { |
|
|
|
function initBranchSelector() { |
|
|
|
const $selectBranch = $('.ui.select-branch'); |
|
|
|
const $selectBranch = $('.ui.select-branch'); |
|
|
|
const $branchMenu = $selectBranch.find('.reference-list-menu'); |
|
|
|
const $branchMenu = $selectBranch.find('.reference-list-menu'); |
|
|
|
|
|
|
|
const $isNewIssue = $branchMenu.hasClass('new-issue'); |
|
|
|
$branchMenu.find('.item:not(.no-select)').click(function () { |
|
|
|
$branchMenu.find('.item:not(.no-select)').click(function () { |
|
|
|
const selectedValue = $(this).data('id'); |
|
|
|
const selectedValue = $(this).data('id'); |
|
|
|
const editMode = $('#editing_mode').val(); |
|
|
|
const editMode = $('#editing_mode').val(); |
|
|
|
$($(this).data('id-selector')).val(selectedValue); |
|
|
|
$($(this).data('id-selector')).val(selectedValue); |
|
|
|
|
|
|
|
if ($isNewIssue) { |
|
|
|
|
|
|
|
$selectBranch.find('.ui .branch-name').text($(this).data('name')); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (editMode === 'true') { |
|
|
|
if (editMode === 'true') { |
|
|
|
const form = $('#update_issueref_form'); |
|
|
|
const form = $('#update_issueref_form'); |
|
|
|