()
| 264 | } |
| 265 | |
| 266 | export async function saveOptions() { |
| 267 | const hasErrors = showValidationErrors(); |
| 268 | if (hasErrors) { |
| 269 | // TODO(philc): If no fields with validation errors are in view, scroll one of them into view |
| 270 | // so it's clear what the issue is. |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | await Settings.setSettings(getSettingsFromForm()); |
| 275 | const el = document.querySelector("#save"); |
| 276 | el.disabled = true; |
| 277 | el.textContent = "Saved"; |
| 278 | } |
| 279 | |
| 280 | function showElement(el, visible) { |
| 281 | el.style.display = visible ? null : "none"; |
no test coverage detected