Skip to content

Commit 20f10af

Browse files
author
Gitea
committed
Branch/tag refreshed without page reload
1 parent 7d339c1 commit 20f10af

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

public/js/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/repo/issue/branch_selector_field.tmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
22
<input id="ref_selector" name="ref" type="hidden" value="{{.Issue.Ref}}">
3-
<input id="editing_mode" name="edit_mode" type="hidden" value="{{.IsIssueWriter}}">
3+
<input id="editing_mode" name="edit_mode" type="hidden" value="{{(or .IsIssueWriter .IsIssuePoster)}}">
44
<form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/ref" id="update_issueref_form">
5-
<input id="api_endpoint" name="api_endpoint" type="hidden" value="{{$.RepoLink}}/issues/{{.Issue.Index}}/title">
65
{{$.CsrfTokenHtml}}
76
</form>
87

web_src/js/index.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ 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();
103102
const selectedValue = $(this).data('id');
104103
const editMode = $('#editing_mode').val();
105104
$($(this).data('id-selector')).val(selectedValue);
106-
$selectBranch.find('.ui .branch-name').text(selectedValue);
107105

108106
if (editMode === 'true') {
109107
const form = $('#update_issueref_form');
@@ -113,11 +111,9 @@ function initBranchSelector() {
113111
ref: selectedValue
114112
},
115113
(data) => {
116-
newValue = data.ref;
114+
$selectBranch.find('.ui .branch-name').text(data.ref);
117115
});
118116
}
119-
120-
$selectBranch.find('.ui .branch-name').text(newValue);
121117
});
122118
$selectBranch.find('.reference.column').click(function () {
123119
$selectBranch.find('.scrolling.reference-list-menu').css('display', 'none');

0 commit comments

Comments
 (0)