diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-01-07 18:50:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-07 10:50:03 +0000 |
commit | 9296c31ff7c42a6d3ddc9a1d7a54b084d786425e (patch) | |
tree | 2ce8dd8726e7474464912a3a0107eccd0e7d3546 /web_src/js/features | |
parent | c5901b622dd5fae8da336b94150e63292489afed (diff) | |
download | gitea-9296c31ff7c42a6d3ddc9a1d7a54b084d786425e.tar.gz gitea-9296c31ff7c42a6d3ddc9a1d7a54b084d786425e.zip |
Fix incorrect URL for "Reference in New Issue" (#28716)
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
Diffstat (limited to 'web_src/js/features')
-rw-r--r-- | web_src/js/features/repo-issue.js | 3 |
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 d995b56a55..6908e0c912 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; @@ -526,7 +527,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'); |