assets/js/theme.js in appscms-tools-theme-3.3.3 vs assets/js/theme.js in appscms-tools-theme-3.3.4
- old
+ new
@@ -1,16 +1,25 @@
-$(document).ready(function () {
- var safuiAlert = $("#safeui-alert");
+---
+---
+
+document.addEventListener("DOMContentLoaded", function () {
+ var safuiAlert = document.querySelector("#safeui-alert");
if (safuiAlert) {
- safuiAlert
- .first()
- .delay(10000)
- .slideUp(1000, function () {
- $(this).remove();
- });
+ 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);
}
});
+
let getLayout = document.getElementById("header");
const layout = getLayout.dataset.layout;
if (layout == "feature-1") {
var removeNav = () => {
let homeLink = document.getElementById("home-link");
@@ -41,6 +50,42 @@
let safeUiAlert = document.getElementById("safeui-alert");
if (safeUiAlert) {
safeUiAlert.style.display = "none";
}
};
+}
+if ("{{ site.removeBootstrapJs }}"==="true") {
+ const languagesModal = document.querySelector("#staticBackdrop");
+const intModalBtn = document.querySelector("#int-modal-btn");
+const closeBtn = document.querySelector("#close-modal");
+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);
+});
+let navbarDropdown = document.querySelector("#navbarDropdown");
+let dropmenu = document.querySelector(".dropmenu");
+navbarDropdown.addEventListener("click", () => {
+ if (dropmenu.classList.contains("show")) {
+ dropmenu.classList.remove("show");
+ } else {
+ dropmenu.classList.add("show");
+ }
+});
+const navbarToggler=document.querySelector('.navbar-toggler')
+const navBar=document.querySelector('#navbarSupportedContent')
+navbarToggler.addEventListener('click',()=>{
+ if (navBar.classList.contains("show")) {
+ navBar.classList.remove("show");
+ } else {
+ navBar.classList.add("show");
+ }
+})
}