| 1669 | } |
| 1670 | |
| 1671 | function setActionButtonBusy(button, busy) { |
| 1672 | if (!button) return; |
| 1673 | if (busy) { |
| 1674 | if (!button.dataset.wasDisabled) button.dataset.wasDisabled = button.disabled ? "true" : "false"; |
| 1675 | button.classList.add("is-busy"); |
| 1676 | button.setAttribute("aria-busy", "true"); |
| 1677 | button.disabled = true; |
| 1678 | return; |
| 1679 | } |
| 1680 | button.classList.remove("is-busy"); |
| 1681 | button.removeAttribute("aria-busy"); |
| 1682 | if (button.dataset.wasDisabled) { |
| 1683 | button.disabled = button.dataset.wasDisabled === "true"; |
| 1684 | delete button.dataset.wasDisabled; |
| 1685 | } |
| 1686 | } |
| 1687 | |
| 1688 | function bindButtonFeedback() { |
| 1689 | document.addEventListener("click", (event) => { |