(updateUrl = true)
| 1363 | * @param updateUrl - Whether to update the URL hash (default: true) |
| 1364 | */ |
| 1365 | export function closeModal(updateUrl = true): void { |
| 1366 | const modal = document.getElementById("file-modal"); |
| 1367 | const installDropdown = document.getElementById("install-dropdown"); |
| 1368 | |
| 1369 | if (modal) { |
| 1370 | modal.classList.add("hidden"); |
| 1371 | modal.classList.remove("visible"); |
| 1372 | } |
| 1373 | if (installDropdown) { |
| 1374 | installDropdown.classList.remove("open"); |
| 1375 | } |
| 1376 | |
| 1377 | // Update URL for deep linking |
| 1378 | if (updateUrl) { |
| 1379 | updateHash(null); |
| 1380 | } |
| 1381 | |
| 1382 | // Restore original document title |
| 1383 | if (originalDocumentTitle) { |
| 1384 | document.title = originalDocumentTitle; |
| 1385 | originalDocumentTitle = null; |
| 1386 | } |
| 1387 | |
| 1388 | // Return focus to trigger element |
| 1389 | if ( |
| 1390 | triggerElement && |
| 1391 | triggerElement.isConnected && |
| 1392 | typeof triggerElement.focus === "function" |
| 1393 | ) { |
| 1394 | triggerElement.focus(); |
| 1395 | } |
| 1396 | |
| 1397 | currentFilePath = null; |
| 1398 | currentFileContent = null; |
| 1399 | currentFileType = null; |
| 1400 | currentViewMode = "raw"; |
| 1401 | triggerElement = null; |
| 1402 | hideSkillFileSwitcher(); |
| 1403 | } |
| 1404 | |
| 1405 | /** |
| 1406 | * Get current file path (for external use) |
no test coverage detected