()
| 180 | |
| 181 | // Wire the "Choose files" button so it always uses the guarded trigger |
| 182 | function wireChooseButton() { |
| 183 | const btn = document.getElementById('customChooseBtn'); |
| 184 | if (!btn || btn.__uploadBound) return; |
| 185 | btn.__uploadBound = true; |
| 186 | |
| 187 | btn.addEventListener('click', (e) => { |
| 188 | e.preventDefault(); |
| 189 | e.stopPropagation(); // don't let it bubble to the drop-area click handler |
| 190 | triggerFilePickerOnce(); |
| 191 | }); |
| 192 | } |
| 193 | |
| 194 | function wireFileInputChange(fileInput) { |
| 195 | if (!fileInput || fileInput.__uploadChangeBound) return; |
no test coverage detected