[XSS] Enable "Clear XSS Choices" button only if some item is selected.

This commit is contained in:
hackademix 2022-03-13 12:19:32 +01:00
parent 29fe044e7b
commit 167a4f3f98
1 changed files with 3 additions and 0 deletions

View File

@ -197,6 +197,9 @@ var UI = (() => {
button = choicesUI.appendChild(document.createElement("button")); button = choicesUI.appendChild(document.createElement("button"));
button.textContent = _("XSS_clearUserChoices"); button.textContent = _("XSS_clearUserChoices");
} }
(list.onchange = () => {
button.disabled = list.selectedOptions.length === 0;
})();
button.onclick = () => { button.onclick = () => {
let xssUserChoices = UI.xssUserChoices; let xssUserChoices = UI.xssUserChoices;
for (let o of [...list.selectedOptions]) { for (let o of [...list.selectedOptions]) {