()
| 3138 | } |
| 3139 | |
| 3140 | function validateDorkOptionsModal() { |
| 3141 | if ( |
| 3142 | !UI.autoImportCheckbox || |
| 3143 | !UI.autoImportResultList || |
| 3144 | !UI.dorkOptionsProceed |
| 3145 | ) { |
| 3146 | return; |
| 3147 | } |
| 3148 | |
| 3149 | const isAutoImportChecked = UI.autoImportCheckbox.checked; |
| 3150 | const isListSelected = UI.autoImportResultList.value !== "0"; |
| 3151 | let proceedEnabled = true; |
| 3152 | let listInvalid = false; |
| 3153 | |
| 3154 | if (isAutoImportChecked && !isListSelected) { |
| 3155 | proceedEnabled = false; |
| 3156 | listInvalid = true; |
| 3157 | } |
| 3158 | |
| 3159 | UI.dorkOptionsProceed.disabled = !proceedEnabled; |
| 3160 | setFieldError(UI.autoImportResultList, listInvalid); |
| 3161 | |
| 3162 | if (proceedEnabled) { |
| 3163 | UI.dorkOptionsProceed.classList.remove("disabled-button"); |
| 3164 | } else { |
| 3165 | UI.dorkOptionsProceed.classList.add("disabled-button"); |
| 3166 | } |
| 3167 | } |
| 3168 | }); // --- End Single Top-Level DOMContentLoaded Listener --- |
no test coverage detected