mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-11 07:05:21 +02:00
Fix bug
This commit is contained in:
parent
cd8130ed5c
commit
cf809d3dd7
@ -252,12 +252,6 @@ function handleDiffLineNumberClick(cell: HTMLElement, e: MouseEvent) {
|
||||
export function initDiffLineSelection() {
|
||||
addDelegatedEventListener<HTMLElement, MouseEvent>(document, 'click', diffLineNumberCellSelector, (cell, e) => {
|
||||
if (e.defaultPrevented) return;
|
||||
// Ignore clicks on or inside code-expander-buttons
|
||||
const target = e.target as HTMLElement;
|
||||
if (target.closest('.code-expander-button') || target.closest('.code-expander-buttons') ||
|
||||
target.closest('button, a, input, select, textarea, summary, [role="button"]')) {
|
||||
return;
|
||||
}
|
||||
handleDiffLineNumberClick(cell, e);
|
||||
});
|
||||
window.addEventListener('hashchange', () => {
|
||||
|
||||
@ -170,9 +170,11 @@ async function loadMoreFiles(btn: Element): Promise<boolean> {
|
||||
const resp = await response.text();
|
||||
const respDoc = parseDom(resp, 'text/html');
|
||||
const respFileBoxes = respDoc.querySelector('#diff-file-boxes')!;
|
||||
const respFileBoxesChildren = Array.from(respFileBoxes.children); // respFileBoxes.children will be empty after replaceWith
|
||||
// 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
|
||||
document.querySelector('#diff-incomplete')!.replaceWith(...Array.from(respFileBoxes.children));
|
||||
document.querySelector('#diff-incomplete')!.replaceWith(...respFileBoxesChildren);
|
||||
for (const el of respFileBoxesChildren) window.htmx.process(el);
|
||||
onShowMoreFiles();
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user