mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 10:54:25 +02:00
Fix all bugs I found in the code
This commit is contained in:
1 parent
a5163fa5f2
commit
9c5b278622
9 files changed
+127
-106
No files matched your search
@@ -1,24 +1,6 @@
|
||||
// initRepoSettingsActionsPermissions is currently a no-op placeholder.
|
||||
// The permission mode radio buttons work via standard HTML form submission
|
||||
// without requiring JavaScript for toggling visibility.
|
||||
export function initRepoSettingsActionsPermissions(): void {
|
||||
const radios = document.querySelectorAll<HTMLInputElement>(
|
||||
'input[name="token_permission_mode"]',
|
||||
);
|
||||
if (!radios.length) return;
|
||||
|
||||
function toggleCustom(): void {
|
||||
const customPerms = document.querySelector<HTMLElement>('#custom-permissions');
|
||||
if (!customPerms) return;
|
||||
|
||||
const selected = document.querySelector<HTMLInputElement>(
|
||||
'input[name="token_permission_mode"]:checked',
|
||||
);
|
||||
|
||||
customPerms.style.display =
|
||||
selected?.value === 'custom' ? 'block' : 'none';
|
||||
}
|
||||
|
||||
for (const radio of radios) {
|
||||
radio.addEventListener('change', toggleCustom);
|
||||
}
|
||||
|
||||
toggleCustom();
|
||||
// No-op - form submission handles permission updates
|
||||
}
|
||||
Reference in new issue
Block a user