(buttonId, loadingText, isLoading)
| 1186 | } |
| 1187 | |
| 1188 | function setButtonLoading(buttonId, loadingText, isLoading) { |
| 1189 | const btn = document.getElementById(buttonId); |
| 1190 | if (!btn) return; |
| 1191 | if (isLoading) { |
| 1192 | if (!btn.dataset.originalText) { |
| 1193 | btn.dataset.originalText = btn.textContent || ""; |
| 1194 | } |
| 1195 | btn.disabled = true; |
| 1196 | btn.textContent = loadingText; |
| 1197 | return; |
| 1198 | } |
| 1199 | btn.disabled = false; |
| 1200 | btn.textContent = btn.dataset.originalText || btn.textContent; |
| 1201 | } |
| 1202 | |
| 1203 | function resetGenerateLinkButtonState() { |
| 1204 | const btn = document.getElementById("generate-link-btn"); |
no outgoing calls
no test coverage detected