mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-19 16:18:11 +00:00
Move the remaining legacy init code, which probed page classes with `querySelector`, to `data-global-init`, so each feature initializes from its own element. `hashchange` listeners now go through one module that runs them in priority order, because independent listeners broke when mount order changed. - Convert issue list, diff, repo create, settings and org team inits to `data-global-init` - Run `hashchange` listeners by priority, the diff scroll handler last - Make the devtest mock's failing log requests deterministic - Add e2e tests for diff tree navigation to folded files and job log permalinks --------- Co-authored-by: silverwind <me@silverwind.io>
15 lines
619 B
TypeScript
15 lines
619 B
TypeScript
import {queryElems, toggleElem} from '../utils/dom.ts';
|
|
import {registerGlobalInitFunc} from '../modules/observer.ts';
|
|
|
|
function initOrgTeamSettings(pageContent: HTMLElement) {
|
|
queryElems(pageContent, 'input[name=permission]', (el) => el.addEventListener('change', () => {
|
|
// Change team access mode
|
|
const val = pageContent.querySelector<HTMLInputElement>('input[name=permission]:checked')?.value;
|
|
toggleElem(pageContent.querySelectorAll('.team-units'), val !== 'admin' && val !== 'write');
|
|
}));
|
|
}
|
|
|
|
export function initOrgTeam() {
|
|
registerGlobalInitFunc('initOrgTeamSettings', initOrgTeamSettings);
|
|
}
|