mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-04 14:46:57 -05:00
The .blob-excerpt elements don't have these data attributes in some cases resulting in bogus http request when expanding a diff and clicking into the expanded area. This prevents those. Should backport to 1.13. Fixes: https://github.com/go-gitea/gitea/issues/13759
This commit is contained in:
parent
25421f08c0
commit
6e14773c44
@ -2089,6 +2089,7 @@ function initCodeView() {
|
|||||||
});
|
});
|
||||||
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
|
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
|
||||||
const {url, query, anchor} = currentTarget.dataset;
|
const {url, query, anchor} = currentTarget.dataset;
|
||||||
|
if (!url) return;
|
||||||
const blob = await $.get(`${url}?${query}&anchor=${anchor}`);
|
const blob = await $.get(`${url}?${query}&anchor=${anchor}`);
|
||||||
currentTarget.closest('tr').outerHTML = blob;
|
currentTarget.closest('tr').outerHTML = blob;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user