mirror of
https://github.com/go-gitea/gitea
synced 2025-11-20 05:08:14 +00:00
Combined all RequestActions implementation and merge upstream and remove WIP
Signed-off-by: Alex Lau(AvengerMoJo) <avengermojo@gmail.com>
This commit is contained in:
committed by
Yu Daike
parent
734ddf7118
commit
ed7fa95528
19
web_src/js/features/require-actions-select.js
Normal file
19
web_src/js/features/require-actions-select.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export function initRequireActionsSelect() {
|
||||
const raselect = document.querySelector('add-require-actions-modal');
|
||||
if (!raselect) return;
|
||||
const checkboxes = document.querySelectorAll('.ui.radio.checkbox');
|
||||
for (const box of checkboxes) {
|
||||
box.addEventListener('change', function() {
|
||||
const hiddenInput = this.nextElementSibling;
|
||||
const isChecked = this.querySelector('input[type="radio"]').checked;
|
||||
hiddenInput.disabled = !isChecked;
|
||||
// Disable other hidden inputs
|
||||
for (const otherbox of checkboxes) {
|
||||
const otherHiddenInput = otherbox.nextElementSibling;
|
||||
if (otherbox !== box) {
|
||||
otherHiddenInput.disabled = isChecked;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user