mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 17:20:53 +02:00
Adress all reviewer feedback
This commit is contained in:
1 parent
92506da0ff
commit
8daef631cf
6 files changed
+85
-107
No files matched your search
@@ -0,0 +1,24 @@
|
||||
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();
|
||||
}
|
||||
@@ -64,6 +64,7 @@ import {initGlobalButtonClickOnEnter, initGlobalButtons, initGlobalDeleteButton}
|
||||
import {initGlobalComboMarkdownEditor, initGlobalEnterQuickSubmit, initGlobalFormDirtyLeaveConfirm} from './features/common-form.ts';
|
||||
import {callInitFunctions} from './modules/init.ts';
|
||||
import {initRepoViewFileTree} from './features/repo-view-file-tree.ts';
|
||||
import {initRepoSettingsActionsPermissions} from './features/repo-settings-actions.ts';
|
||||
|
||||
const initStartTime = performance.now();
|
||||
const initPerformanceTracer = callInitFunctions([
|
||||
@@ -158,6 +159,7 @@ const initPerformanceTracer = callInitFunctions([
|
||||
initOAuth2SettingsDisableCheckbox,
|
||||
|
||||
initRepoFileView,
|
||||
initRepoSettingsActionsPermissions,
|
||||
]);
|
||||
|
||||
// it must be the last one, then the "querySelectorAll" only needs to be executed once for global init functions.
|
||||
|
||||
Reference in new issue
Block a user