From d57eebc8292eaa1d436d0ae01ea9a543d77bfc71 Mon Sep 17 00:00:00 2001 From: Zyrenth Date: Sat, 6 Jul 2024 22:47:48 +0200 Subject: [PATCH] support for disabled dropdowns --- frontend/www/src/modules/modal.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/www/src/modules/modal.ts b/frontend/www/src/modules/modal.ts index e806e3d..de0eb2e 100644 --- a/frontend/www/src/modules/modal.ts +++ b/frontend/www/src/modules/modal.ts @@ -340,7 +340,8 @@ async function addDropdown(modal: HTMLElement, param: EnumParam) { for (let i = 0; i < options.length; i++) { const option = document.createElement("option"); option.value = i.toString(); - option.textContent = options[i]; + option.disabled = options[i].startsWith('[DISABLED] '); + option.textContent = options[i].replace(/\[DISABLED\] /g, ''); select.appendChild(option); }