Refactor legacy line-number and scroll code (#33094)

1. remove jquery
2. rewrite the "line number selection", fix various edge cases
3. fix the scroll
This commit is contained in:
wxiaoguang 2025-01-04 10:56:07 +08:00 committed by GitHub
parent 188e0ee8e4
commit 2b064b8637
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 71 additions and 139 deletions

View file

@ -19,6 +19,7 @@ import {
import {POST, GET} from '../modules/fetch.ts';
import {fomanticQuery} from '../modules/fomantic/base.ts';
import {createTippy} from '../modules/tippy.ts';
import {invertFileFolding} from './file-fold.ts';
const {pageData, i18n} = window.config;
@ -244,4 +245,8 @@ export function initRepoDiffView() {
initRepoDiffFileViewToggle();
initViewedCheckboxListenerFor();
initExpandAndCollapseFilesButton();
addDelegatedEventListener(document, 'click', '.fold-file', (el) => {
invertFileFolding(el.closest('.file-content'), el);
});
}