update seznamu sluzeb
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user