mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-13 12:33:43 +02:00
Fix #24801 <img width="1123" height="503" alt="image" src="https://github.com/user-attachments/assets/823f4214-e08a-4506-9018-057c50e7fc52" /> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
18 lines
704 B
TypeScript
18 lines
704 B
TypeScript
import {queryElems, toggleElem} from '../utils/dom.ts';
|
|
|
|
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');
|
|
}));
|
|
}
|
|
|
|
export function initOrgTeam() {
|
|
if (!document.querySelector('.page-content.organization')) return;
|
|
initOrgTeamSettings();
|
|
}
|