--- --- if ("{{ site.safeui }}"==="true") { document.addEventListener("DOMContentLoaded", function () { var safuiAlert = document.querySelector("#safeui-alert"); if (safuiAlert) { setTimeout(function () { safuiAlert.style.transition = "1s"; safuiAlert.style.height = "0"; safuiAlert.style.paddingTop = "0"; safuiAlert.style.paddingBottom = "0"; safuiAlert.style.marginTop = "0"; safuiAlert.style.marginBottom = "0"; setTimeout(function () { safuiAlert.parentNode.removeChild(safuiAlert); }, 1000); }, 10000); } }); } const hamburger = document.querySelector("#hamburger"); const appscmsToolbar = document.querySelector(".appscms-toolbar"); const appscmsToolbarListItems = document.querySelectorAll( ".appscms-toolbar-list-item-span" ); hamburger.addEventListener("click", () => { if (hamburger.dataset.open === "1") { hamburger.dataset.open = "0"; appscmsToolbar.style.right = "-272px"; appscmsToolbar.style.display = "none"; hamburger.innerHTML = ` `; } else { hamburger.dataset.open = "1"; appscmsToolbar.style.right = "0px"; appscmsToolbar.style.display = "block"; hamburger.innerHTML = ` `; } }); Array.from(appscmsToolbarListItems).map((item) => { item.addEventListener("click", (e) => { e.preventDefault(); var style = window.getComputedStyle(item.nextElementSibling); var maxHeight = style.getPropertyValue("max-height"); if (maxHeight && maxHeight !== "0px") { // If the item is expanded, collapse it item.nextElementSibling.style.maxHeight = "0"; item.nextElementSibling.style.opacity = "0"; item.nextElementSibling.style.height = "0"; } else { // If the item is collapsed, expand it item.nextElementSibling.style.maxHeight = item.nextElementSibling.scrollHeight + "px"; item.nextElementSibling.style.opacity = "1"; item.nextElementSibling.style.height = "auto"; } }); }); if ("{{ site.removeBootstrapJs }}" === "true") { const languagesModal = document.querySelector("#staticBackdrop"); const intModalBtn = document.querySelector("#int-modal-btn"); const closeBtn = document.querySelector("#close-modal"); if (intModalBtn) { intModalBtn.addEventListener("click", () => { languagesModal.style.display = "block"; languagesModal.classList.add("show"); let modal = document.createElement("div"); modal.classList.add("modal-backdrop", "show"); document.body.appendChild(modal); }); closeBtn.addEventListener("click", () => { languagesModal.style.display = "none"; languagesModal.classList.remove("show"); let modal = document.querySelector(".modal-backdrop"); document.body.removeChild(modal); }); } }