summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-01-07 23:40:29 +0800
committerGitHub <noreply@github.com>2024-01-07 23:40:29 +0800
commitdef178ce323e6c300e02b9aa225227178e5ca2e1 (patch)
tree71a8105f7d4a912ef4b2f9730b3d5e4d8a0e9ca1 /web_src
parent2399b4d483162e182fc09a3c7ffaf6359a0b4d90 (diff)
downloadgitea-def178ce323e6c300e02b9aa225227178e5ca2e1.tar.gz
gitea-def178ce323e6c300e02b9aa225227178e5ca2e1.zip
Fix incorrect URL for "Reference in New Issue" (#28716) (#28723)
Backport #28716 by wxiaoguang Gitea prefers to use relative URLs in code (to make multiple domain work for some users) So it needs to use `toAbsoluteUrl` to generate a full URL when click "Reference in New Issues" And add some comments in the test code Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/repo-issue.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js
index 2cc0730af6..0be118db31 100644
--- a/web_src/js/features/repo-issue.js
+++ b/web_src/js/features/repo-issue.js
@@ -4,6 +4,7 @@ import {showTemporaryTooltip, createTippy} from '../modules/tippy.js';
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
import {setFileFolding} from './file-fold.js';
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
+import {toAbsoluteUrl} from '../utils.js';
const {appSubUrl, csrfToken} = window.config;
@@ -527,7 +528,7 @@ export function initRepoIssueReferenceIssue() {
const $this = $(this);
const content = $(`#${$this.data('target')}`).text();
const poster = $this.data('poster-username');
- const reference = $this.data('reference');
+ const reference = toAbsoluteUrl($this.data('reference'));
const $modal = $($this.data('modal'));
$modal.find('textarea[name="content"]').val(`${content}\n\n_Originally posted by @${poster} in ${reference}_`);
$modal.modal('show');