Files
Atay-Makhzan/web_src/js/features/org-team.ts
T

18 lines
704 B
TypeScript
Raw Normal View History

2025-01-06 17:38:42 +08:00
import {queryElems, toggleElem} from '../utils/dom.ts';
2021-10-17 01:28:04 +08:00
2025-01-06 17:38:42 +08:00
function initOrgTeamSettings() {
// on the page "page-content organization new team"
const pageContent = document.querySelector('.page-content.organization.new.team');
if (!pageContent) return;
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');
}));
2021-10-17 01:28:04 +08:00
}
2025-01-06 17:38:42 +08:00
export function initOrgTeam() {
if (!document.querySelector('.page-content.organization')) return;
initOrgTeamSettings();
}