update seznamu sluzeb

This commit is contained in:
JiriUhlir
2026-05-29 12:07:13 +02:00
parent ed194093e6
commit 1ade865df4
3 changed files with 373 additions and 58 deletions
+35
View File
@@ -82,3 +82,38 @@ function copyText(button) {
.catch(() => showCopied(button, false));
return false;
}
function openResourceModal(id) {
const modal = document.getElementById(id);
if (!modal) {
return false;
}
if (typeof modal.showModal === "function") {
modal.showModal();
} else {
modal.setAttribute("open", "");
}
return false;
}
function closeResourceModal(id) {
const modal = document.getElementById(id);
if (!modal) {
return false;
}
if (typeof modal.close === "function") {
modal.close();
} else {
modal.removeAttribute("open");
}
return false;
}
document.addEventListener("click", (event) => {
const modal = event.target;
if (typeof HTMLDialogElement !== "undefined" && modal instanceof HTMLDialogElement && modal.classList.contains("resource-modal")) {
modal.close();
}
});