mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-13 00:16:07 +02:00
This commit is contained in:
parent
5973437abb
commit
4f1408cdcf
@ -170,7 +170,9 @@ async function loadMoreFiles(btn: Element): Promise<boolean> {
|
|||||||
const respFileBoxes = respDoc.querySelector('#diff-file-boxes');
|
const respFileBoxes = respDoc.querySelector('#diff-file-boxes');
|
||||||
// the response is a full HTML page, we need to extract the relevant contents:
|
// the response is a full HTML page, we need to extract the relevant contents:
|
||||||
// * append the newly loaded file list items to the existing list
|
// * append the newly loaded file list items to the existing list
|
||||||
document.querySelector('#diff-incomplete').replaceWith(...Array.from(respFileBoxes.children));
|
const respFileBoxesChildren = Array.from(respFileBoxes.children); // "children:HTMLCollection" will be empty after replaceWith
|
||||||
|
document.querySelector('#diff-incomplete').replaceWith(...respFileBoxesChildren);
|
||||||
|
for (const el of respFileBoxesChildren) window.htmx.process(el);
|
||||||
onShowMoreFiles();
|
onShowMoreFiles();
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -200,7 +202,7 @@ function initRepoDiffShowMore() {
|
|||||||
const resp = await response.text();
|
const resp = await response.text();
|
||||||
const respDoc = parseDom(resp, 'text/html');
|
const respDoc = parseDom(resp, 'text/html');
|
||||||
const respFileBody = respDoc.querySelector('#diff-file-boxes .diff-file-body .file-body');
|
const respFileBody = respDoc.querySelector('#diff-file-boxes .diff-file-body .file-body');
|
||||||
const respFileBodyChildren = Array.from(respFileBody.children); // respFileBody.children will be empty after replaceWith
|
const respFileBodyChildren = Array.from(respFileBody.children); // "children:HTMLCollection" will be empty after replaceWith
|
||||||
el.parentElement.replaceWith(...respFileBodyChildren);
|
el.parentElement.replaceWith(...respFileBodyChildren);
|
||||||
for (const el of respFileBodyChildren) window.htmx.process(el);
|
for (const el of respFileBodyChildren) window.htmx.process(el);
|
||||||
// FIXME: calling onShowMoreFiles is not quite right here.
|
// FIXME: calling onShowMoreFiles is not quite right here.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user