From b003116fcaf6c1501eb210f7cda83e8f64cbc608 Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Fri, 1 Jan 2021 02:32:11 +0800 Subject: fix branch selector on new issue page (#14194) fix #14185 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao --- web_src/js/index.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web_src') diff --git a/web_src/js/index.js b/web_src/js/index.js index 93708e4fdc..ef674ad6a6 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -111,10 +111,15 @@ function initEditForm() { function initBranchSelector() { const $selectBranch = $('.ui.select-branch'); const $branchMenu = $selectBranch.find('.reference-list-menu'); + const $isNewIssue = $branchMenu.hasClass('new-issue'); $branchMenu.find('.item:not(.no-select)').click(function () { const selectedValue = $(this).data('id'); const editMode = $('#editing_mode').val(); $($(this).data('id-selector')).val(selectedValue); + if ($isNewIssue) { + $selectBranch.find('.ui .branch-name').text($(this).data('name')); + return; + } if (editMode === 'true') { const form = $('#update_issueref_form'); -- cgit v1.2.3