Skip to content

Commit 92a031f

Browse files
author
Gitea
committed
Use ref returned from POST to update the field
1 parent 668d3c0 commit 92a031f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

public/js/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_src/js/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ function initBranchSelector() {
9999
const $selectBranch = $('.ui.select-branch');
100100
const $branchMenu = $selectBranch.find('.reference-list-menu');
101101
$branchMenu.find('.item:not(.no-select)').click(function () {
102+
let newValue = $selectBranch.find('.ui .branch-name').text();
102103
const selectedValue = $(this).data('id');
103104
const editMode = $('#editing_mode').val();
104105
$($(this).data('id-selector')).val(selectedValue);
@@ -111,10 +112,12 @@ function initBranchSelector() {
111112
_csrf: csrf,
112113
ref: selectedValue
113114
},
114-
() => {
115-
reload();
115+
(data) => {
116+
newValue = data.ref;
116117
});
117118
}
119+
120+
$selectBranch.find('.ui .branch-name').text(newValue);
118121
});
119122
$selectBranch.find('.reference.column').click(function () {
120123
$selectBranch.find('.scrolling.reference-list-menu').css('display', 'none');

0 commit comments

Comments
 (0)