1818 lines
108 KiB
JavaScript
Executable File
1818 lines
108 KiB
JavaScript
Executable File
var app = {
|
|
id: "#app",
|
|
class: "app",
|
|
isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth < 767,
|
|
bootstrap: {
|
|
tooltip: { attr: 'data-bs-toggle="tooltip"' },
|
|
popover: { attr: 'data-bs-toggle="popover"' },
|
|
modal: { attr: 'data-bs-toggle="modal"', dismissAttr: 'data-bs-dismiss="modal"', event: { hidden: "hidden.bs.modal" } },
|
|
nav: { class: "nav", tabs: { class: "nav-tabs", activeClass: "active", itemClass: "nav-item", itemLinkClass: "nav-link" } },
|
|
},
|
|
ajax: {
|
|
attr: 'data-toggle="ajax"',
|
|
clearOption: "",
|
|
clearElement:
|
|
"#app-sidebar-float-submenu, .jvectormap-label, .jvector-label, .AutoFill_border ,#gritter-notice-wrapper, .ui-autocomplete, .colorpicker, .FixedHeader_Header, .FixedHeader_Cloned .lightboxOverlay, .lightbox, .introjs-hints, .nvtooltip, .sp-container, .dz-hidden-input, .lightboxOverlay, .ui-helper-hidden-accessible",
|
|
emptyElement: '[data-id="app-extra-elm"]',
|
|
loader: { id: "#app-content-loader", html: '<span class="spinner d-block mx-auto my-5"></span>', class: "app-content-loading" },
|
|
error: { html: '<div class="px-3 text-center fs-20px"><i class="fa fa-warning fa-lg text-muted me-1"></i> <span class="fw-600 text-inverse">Error 404! Page not found.</span></div>' },
|
|
},
|
|
header: {
|
|
id: "#header",
|
|
class: "app-header",
|
|
hasScrollClass: "has-scroll",
|
|
brand: { class: "navbar-brand" },
|
|
floatingForm: { toggleAttr: 'data-toggle="app-header-floating-form"', dismissAttr: 'data-dismiss="app-header-floating-form"', toggledClass: "app-header-floating-form-toggled" },
|
|
inverse: { class: "app-header-inverse" },
|
|
},
|
|
sidebar: {
|
|
id: "#sidebar",
|
|
class: "app-sidebar",
|
|
scrollBar: { localStorage: "appSidebarScrollPosition", dom: "" },
|
|
bg: { class: "app-sidebar-bg" },
|
|
menu: {
|
|
class: "menu",
|
|
disableAnimationAttr: "data-disable-slide-animation",
|
|
disableAutoCollapseAttr: "data-disable-auto-collapse",
|
|
animationTime: 250,
|
|
headerClass: "menu-header",
|
|
itemClass: "menu-item",
|
|
itemLinkClass: "menu-link",
|
|
hasSubClass: "has-sub",
|
|
activeClass: "active",
|
|
expandingClass: "expanding",
|
|
expandClass: "expand",
|
|
closingClass: "closing",
|
|
closedClass: "closed",
|
|
submenu: { class: "menu-submenu" },
|
|
},
|
|
profile: { class: "menu-profile", toggleAttr: 'data-toggle="app-sidebar-profile"', targetAttr: "data-target" },
|
|
mobile: {
|
|
toggleAttr: 'data-toggle="app-sidebar-mobile"',
|
|
dismissAttr: 'data-dismiss="app-sidebar-mobile"',
|
|
toggledClass: "app-sidebar-mobile-toggled",
|
|
closedClass: "app-sidebar-mobile-closed",
|
|
backdrop: { class: "app-sidebar-mobile-backdrop" },
|
|
},
|
|
minify: { toggleAttr: 'data-toggle="app-sidebar-minify"', toggledClass: "app-sidebar-minified", cookieName: "app-sidebar-minified" },
|
|
floatSubmenu: {
|
|
id: "#app-sidebar-float-submenu",
|
|
dom: "",
|
|
timeout: "",
|
|
class: "app-sidebar-float-submenu",
|
|
container: { class: "app-sidebar-float-submenu-container" },
|
|
arrow: { id: "#app-sidebar-float-submenu-arrow", class: "app-sidebar-float-submenu-arrow" },
|
|
line: { id: "#app-sidebar-float-submenu-line", class: "app-sidebar-float-submenu-line" },
|
|
overflow: { class: "overflow-scroll mh-100vh" },
|
|
},
|
|
search: { class: "menu-search", toggleAttr: 'data-sidebar-search="true"', hideClass: "d-none", foundClass: "has-text" },
|
|
hover: { class: "app-with-hover-sidebar" },
|
|
transparent: { class: "app-sidebar-transparent" },
|
|
},
|
|
sidebarEnd: {
|
|
class: "app-sidebar-end",
|
|
toggleAttr: 'data-toggle="app-sidebar-end"',
|
|
toggledClass: "app-sidebar-end-toggled",
|
|
collapsedClass: "app-sidebar-end-collapsed",
|
|
mobile: {
|
|
toggleAttr: 'data-toggle="app-sidebar-end-mobile"',
|
|
dismissAttr: 'data-dismiss="app-sidebar-end-mobile"',
|
|
toggledClass: "app-sidebar-end-mobile-toggled",
|
|
collapsedClass: "app-sidebar-end-mobile-collapsed",
|
|
closedClass: "app-sidebar-end-mobile-closed",
|
|
},
|
|
},
|
|
topMenu: {
|
|
id: "#top-menu",
|
|
class: "app-top-menu",
|
|
mobile: { toggleAttr: 'data-toggle="app-top-menu-mobile"' },
|
|
menu: { class: "menu", itemClass: "menu-item", itemLinkClass: "menu-link", activeClass: "active", hasSubClass: "has-sub", expandClass: "expand", submenu: { class: "menu-submenu" } },
|
|
control: {
|
|
class: "menu-control",
|
|
startClass: "menu-control-start",
|
|
endClass: "menu-control-end",
|
|
showClass: "show",
|
|
buttonPrev: { class: "menu-control-start", toggleAttr: 'data-toggle="app-top-menu-prev"' },
|
|
buttonNext: { class: "menu-control-end", toggleAttr: 'data-toggle="app-top-menu-next"' },
|
|
},
|
|
},
|
|
scrollBar: { attr: 'data-scrollbar="true"', skipMobileAttr: "data-skip-mobile", initAttr: "data-init", heightAttr: "data-height", wheelPropagationAttr: "data-wheel-propagation" },
|
|
scrollTo: { toggleAttr: 'data-toggle="scroll-to"', targetAttr: "data-target" },
|
|
content: { id: "#content", class: "app-content", fullHeight: { class: "app-content-full-height" }, fullWidth: { class: "app-content-full-width" } },
|
|
layout: {
|
|
sidebarEnd: { class: "app-with-end-sidebar" },
|
|
sidebarWide: { class: "app-with-wide-sidebar" },
|
|
sidebarMinified: { class: "app-sidebar-minified" },
|
|
sidebarTwo: { class: "app-with-two-sidebar" },
|
|
withoutHeader: { class: "app-without-header" },
|
|
withoutSidebar: { class: "app-without-sidebar" },
|
|
topMenu: { class: "app-with-top-menu" },
|
|
boxedLayout: { class: "boxed-layout" },
|
|
},
|
|
loader: { class: "app-loader", fadingClass: "fading", fadingTime: 200, loadedClass: "loaded" },
|
|
panel: {
|
|
class: "panel",
|
|
headClass: "panel-heading",
|
|
titleClass: "panel-title",
|
|
bodyClass: "panel-body",
|
|
expandClass: "panel-expand",
|
|
loadingClass: "panel-loading",
|
|
loader: { class: "panel-loader", html: '<span class="spinner spinner-sm"></span>' },
|
|
toggle: {
|
|
remove: { attr: 'data-toggle="panel-remove"', tooltipText: "Remove" },
|
|
collapse: { attr: 'data-toggle="panel-collapse"', tooltipText: "Collapse / Expand" },
|
|
reload: { attr: 'data-toggle="panel-reload"', tooltipText: "Reload" },
|
|
expand: { attr: 'data-toggle="panel-expand"', tooltipText: "Expand / Compress" },
|
|
},
|
|
draggable: { disableAttr: 'data-sortable="false"', connectedTarget: ".row > [class*=col]", spinnerHtml: '<i class="fa fa-spinner fa-spin ms-2" data-id="title-spinner"></i>' },
|
|
sortable: { class: "ui-sortable", attr: "data-sortable-id", spinnerAttr: 'data-id="title-spinner"', disableAttr: 'data-sortable="false"', parentAttr: 'class*="col-"' },
|
|
localStorage: {
|
|
notSupportMessage: "Your browser is not supported with the local storage",
|
|
loadedEvent: "localstorage-position-loaded",
|
|
reset: {
|
|
attr: 'data-toggle="reset-local-storage"',
|
|
modal: {
|
|
id: "#modalResetLocalStorage",
|
|
title: "Reset Local Storage Confirmation",
|
|
message: "Would you like to RESET all your saved widgets and clear Local Storage?",
|
|
alert: "info",
|
|
confirmResetAttr: 'data-toggle="confirm-reset-local-storage"',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
scrollToTopBtn: { showClass: "show", heightShow: 200, toggleAttr: 'data-toggle="scroll-to-top"', scrollSpeed: 500 },
|
|
unlimitedTabs: {
|
|
class: "tab-overflow",
|
|
overflowLeft: { class: "overflow-left" },
|
|
overflowRight: { class: "overflow-right" },
|
|
buttonNext: { class: "next-button", toggleAttr: 'data-click="next-tab"' },
|
|
buttonPrev: { class: "prev-button", toggleAttr: 'data-click="prev-tab"' },
|
|
},
|
|
themePanel: {
|
|
class: "theme-panel",
|
|
toggleAttr: 'data-toggle="theme-panel-expand"',
|
|
cookieName: "theme-panel-expand",
|
|
activeClass: "active",
|
|
themeListCLass: "theme-list",
|
|
themeListItemCLass: "theme-list-item",
|
|
theme: { toggleAttr: 'data-toggle="theme-selector"', cookieName: "app-theme", activeClass: "active", classAttr: "data-theme-class" },
|
|
themeHeader: { toggleAttr: 'name="app-header-inverse"', cookieName: "app-theme-header" },
|
|
themeHeaderFixed: {
|
|
class: "app-header-fixed",
|
|
toggleAttr: 'name="app-header-fixed"',
|
|
cookieName: "app-header-fixed",
|
|
disabledClass: "app-header-fixed-disabled",
|
|
errorMessage: "Default Header with Fixed Sidebar option is not supported. Proceed with Default Header with Default Sidebar.",
|
|
},
|
|
themeSidebarGrid: { class: "app-sidebar-grid", toggleAttr: 'name="app-sidebar-grid"', cookieName: "app-sidebar-grid" },
|
|
themeGradientEnabled: { class: "app-gradient-enabled", toggleAttr: 'name="app-gradient-enabled"', cookieName: "app-gradient-enabled" },
|
|
themeSidebarFixed: {
|
|
class: "app-sidebar-fixed",
|
|
toggleAttr: 'name="app-sidebar-fixed"',
|
|
cookieName: "app-sidebar-fixed",
|
|
disabledClass: "app-sidebar-fixed-disabled",
|
|
errorMessage: "Default Header with Fixed Sidebar option is not supported. Proceed with Fixed Header with Fixed Sidebar.",
|
|
mobileErrorMessage: "Mobile view sidebar will always fixed",
|
|
},
|
|
themeDarkMode: { class: "dark-mode", toggleAttr: 'name="app-theme-dark-mode"', cookieName: "app-theme-dark-mode" },
|
|
},
|
|
animation: { attr: "data-animation", valueAttr: "data-value", speed: 300, effect: "swing" },
|
|
dismissClass: { toggleAttr: "data-dismiss-class", targetAttr: "data-target" },
|
|
toggleClass: { toggleAttr: "data-toggle-class", targetAttr: "data-target" },
|
|
helper: { display: { none: "d-none" }, margin: { left: { 0: "ms-0" }, right: { 0: "me-0" } } },
|
|
darkMode: { attr: "data-bs-theme", value: "dark", eventName: "theme-reload" },
|
|
font: {},
|
|
color: {},
|
|
variablePrefix: "bs-",
|
|
variableFontList: ["body-font-family", "body-font-size", "body-font-weight", "body-line-height"],
|
|
variableColorList: [
|
|
"theme",
|
|
"theme-rgb",
|
|
"theme-color",
|
|
"theme-color-rgb",
|
|
"component-color",
|
|
"component-color-rgb",
|
|
"component-bg",
|
|
"component-bg-rgb",
|
|
"component-secondary-bg",
|
|
"component-bg-rgb",
|
|
"component-tertiary-bg",
|
|
"component-tertiary-bg-rgb",
|
|
"default",
|
|
"default-rgb",
|
|
"primary",
|
|
"primary-rgb",
|
|
"primary-bg-subtle",
|
|
"primary-text",
|
|
"primary-border-subtle",
|
|
"secondary",
|
|
"secondary-rgb",
|
|
"secondary-bg-subtle",
|
|
"secondary-text",
|
|
"secondary-border-subtle",
|
|
"success",
|
|
"success-rgb",
|
|
"success-bg-subtle",
|
|
"success-text",
|
|
"success-border-subtle",
|
|
"warning",
|
|
"warning-rgb",
|
|
"warning-bg-subtle",
|
|
"warning-text",
|
|
"warning-border-subtle",
|
|
"info",
|
|
"info-rgb",
|
|
"info-bg-subtle",
|
|
"info-text",
|
|
"info-border-subtle",
|
|
"danger",
|
|
"danger-rgb",
|
|
"danger-bg-subtle",
|
|
"danger-text",
|
|
"danger-border-subtle",
|
|
"light",
|
|
"light-rgb",
|
|
"light-bg-subtle",
|
|
"light-text",
|
|
"light-border-subtle",
|
|
"dark",
|
|
"dark-rgb",
|
|
"dark-bg-subtle",
|
|
"dark-text",
|
|
"dark-border-subtle",
|
|
"black",
|
|
"black-rgb",
|
|
"blue",
|
|
"blue-rgb",
|
|
"inverse",
|
|
"inverse-rgb",
|
|
"white",
|
|
"white-rgb",
|
|
"red",
|
|
"red-rgb",
|
|
"teal",
|
|
"teal-rgb",
|
|
"indigo",
|
|
"indigo-rgb",
|
|
"orange",
|
|
"orange-rgb",
|
|
"purple",
|
|
"purple-rgb",
|
|
"yellow",
|
|
"yellow-rgb",
|
|
"green",
|
|
"green-rgb",
|
|
"pink",
|
|
"pink-rgb",
|
|
"cyan",
|
|
"cyan-rgb",
|
|
"gray",
|
|
"gray-rgb",
|
|
"lime",
|
|
"lime-rgb",
|
|
"gray-100",
|
|
"gray-200",
|
|
"gray-300",
|
|
"gray-400",
|
|
"gray-500",
|
|
"gray-600",
|
|
"gray-700",
|
|
"gray-800",
|
|
"gray-900",
|
|
"gray-100-rgb",
|
|
"gray-200-rgb",
|
|
"gray-300-rgb",
|
|
"gray-400-rgb",
|
|
"gray-500-rgb",
|
|
"gray-600-rgb",
|
|
"gray-700-rgb",
|
|
"gray-800-rgb",
|
|
"gray-900-rgb",
|
|
"muted",
|
|
"muted-rgb",
|
|
"emphasis-color",
|
|
"emphasis-color-rgb",
|
|
"heading-color",
|
|
"body-bg",
|
|
"body-bg-rgb",
|
|
"body-color",
|
|
"body-color-rgb",
|
|
"secondary-color",
|
|
"secondary-color-rgb",
|
|
"secondary-bg",
|
|
"secondary-bg-rgb",
|
|
"tertiary-color",
|
|
"tertiary-color-rgb",
|
|
"tertiary-bg",
|
|
"tertiary-bg-rgb",
|
|
"link-color",
|
|
"link-color-rgb",
|
|
"link-hover-color",
|
|
"link-hover-color-rgb",
|
|
"border-color",
|
|
"border-color-translucent",
|
|
],
|
|
breakpoints: { xs: 0, sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1400, xxxl: 1800 },
|
|
},
|
|
slideUp = function (e, a = app.animation.speed) {
|
|
var t;
|
|
e.classList.contains("transitioning") ||
|
|
(e.classList.add("transitioning"),
|
|
(t = e.offsetHeight),
|
|
(e.style.height = t + "px"),
|
|
(e.style.transition = `height ${a}ms ease, padding ${a}ms ease, margin ${a}ms ease`),
|
|
(e.style.boxSizing = "border-box"),
|
|
(e.style.overflow = "hidden"),
|
|
requestAnimationFrame(() => {
|
|
(e.style.height = "0"),
|
|
(e.style.paddingTop = "0"),
|
|
(e.style.paddingBottom = "0"),
|
|
(e.style.marginTop = "0"),
|
|
(e.style.marginBottom = "0"),
|
|
setTimeout(() => {
|
|
(e.style.display = "none"),
|
|
e.style.removeProperty("height"),
|
|
e.style.removeProperty("padding-top"),
|
|
e.style.removeProperty("padding-bottom"),
|
|
e.style.removeProperty("margin-top"),
|
|
e.style.removeProperty("margin-bottom"),
|
|
e.style.removeProperty("overflow"),
|
|
e.style.removeProperty("transition"),
|
|
e.classList.remove("transitioning");
|
|
}, a);
|
|
}));
|
|
},
|
|
slideDown = function (t, s = app.animation.speed) {
|
|
if (!t.classList.contains("transitioning")) {
|
|
t.classList.add("transitioning"), t.style.removeProperty("display");
|
|
let e = window.getComputedStyle(t).display,
|
|
a = ("none" === e && (e = "block"), (t.style.display = e), t.scrollHeight);
|
|
(t.style.height = "0"),
|
|
(t.style.paddingTop = "0"),
|
|
(t.style.paddingBottom = "0"),
|
|
(t.style.marginTop = "0"),
|
|
(t.style.marginBottom = "0"),
|
|
(t.style.boxSizing = "border-box"),
|
|
(t.style.overflow = "hidden"),
|
|
requestAnimationFrame(() => {
|
|
(t.style.transition = `height ${s}ms ease, padding ${s}ms ease, margin ${s}ms ease`),
|
|
(t.style.height = a + "px"),
|
|
t.style.removeProperty("padding-top"),
|
|
t.style.removeProperty("padding-bottom"),
|
|
t.style.removeProperty("margin-top"),
|
|
t.style.removeProperty("margin-bottom"),
|
|
setTimeout(() => {
|
|
t.style.removeProperty("height"), t.style.removeProperty("overflow"), t.style.removeProperty("transition"), t.classList.remove("transitioning");
|
|
}, s);
|
|
});
|
|
}
|
|
},
|
|
slideToggle = function (e, a = app.animation.speed) {
|
|
return ("none" === window.getComputedStyle(e).display ? slideDown : slideUp)(e, a);
|
|
},
|
|
setCookie = function (e, a) {
|
|
var t = new Date(),
|
|
s = t.getTime();
|
|
t.setTime(s + 36e6), (document.cookie = e + "=" + a + ";expires=" + t.toUTCString() + ";path=/");
|
|
},
|
|
getCookie = function (e) {
|
|
var t = e + "=",
|
|
s = decodeURIComponent(document.cookie).split(";");
|
|
for (let a = 0; a < s.length; a++) {
|
|
let e = s[a];
|
|
for (; " " == e.charAt(0); ) e = e.substring(1);
|
|
if (0 == e.indexOf(t)) return e.substring(t.length, e.length);
|
|
}
|
|
return "";
|
|
},
|
|
getParents = function (e, a) {
|
|
void 0 === a && (a = document);
|
|
for (var t = [], s = e.parentNode; s !== a; ) {
|
|
var l = s;
|
|
t.push(l), (s = l.parentNode);
|
|
}
|
|
return t.push(a), t;
|
|
},
|
|
setInnerHTML = function (e, a) {
|
|
(e.innerHTML = a),
|
|
Array.from(e.querySelectorAll("script")).forEach((e) => {
|
|
let a = document.createElement("script");
|
|
Array.from(e.attributes).forEach((e) => a.setAttribute(e.name, e.value)), a.appendChild(document.createTextNode(e.innerHTML)), e.parentNode.replaceChild(a, e);
|
|
});
|
|
},
|
|
handleScrollbar = function () {
|
|
for (var e = document.querySelectorAll("[" + app.scrollBar.attr + "]"), a = 0; a < e.length; a++) generateScrollbar(e[a]);
|
|
},
|
|
generateScrollbar = function (e) {
|
|
var a;
|
|
e.scrollbarInit ||
|
|
(app.isMobile && e.getAttribute(app.scrollBar.skipMobileAttr)) ||
|
|
((a = e.getAttribute(app.scrollBar.heightAttr) ? e.getAttribute(app.scrollBar.heightAttr) : e.offsetHeight),
|
|
(e.style.height = a),
|
|
(e.scrollbarInit = !0),
|
|
app.isMobile
|
|
? (e.style.overflowX = "scroll")
|
|
: ((a = !!e.getAttribute(app.scrollBar.wheelPropagationAttr) && e.getAttribute(app.scrollBar.wheelPropagationAttr)),
|
|
e.closest("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")") && 0 !== e.closest("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")").length
|
|
? (app.sidebar.scrollBar.dom = new PerfectScrollbar(e, { wheelPropagation: a }))
|
|
: new PerfectScrollbar(e, { wheelPropagation: a })));
|
|
},
|
|
handleSidebarMenuToggle = function (t, s) {
|
|
t.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var a = this.nextElementSibling,
|
|
e =
|
|
(t.map(function (e) {
|
|
e = e.nextElementSibling;
|
|
e !== a && (slideUp(e, s), e.closest("." + app.sidebar.menu.itemClass).classList.remove(app.sidebar.menu.expandClass), e.closest("." + app.sidebar.menu.itemClass).classList.add(app.sidebar.menu.closedClass));
|
|
}),
|
|
a.closest("." + app.sidebar.menu.itemClass));
|
|
e.classList.contains(app.sidebar.menu.expandClass) || (e.classList.contains(app.sidebar.menu.activeClass) && !a.style.display)
|
|
? (e.classList.remove(app.sidebar.menu.expandClass), e.classList.add(app.sidebar.menu.closedClass))
|
|
: (e.classList.add(app.sidebar.menu.expandClass), e.classList.remove(app.sidebar.menu.closedClass)),
|
|
slideToggle(a, s);
|
|
};
|
|
});
|
|
},
|
|
handleSidebarMenu = function () {
|
|
var e = document.querySelector("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")"),
|
|
a = e && e.getAttribute(app.sidebar.menu.disableAnimationAttr) ? 0 : app.sidebar.menu.animationTime,
|
|
e = (e && e.getAttribute(app.sidebar.menu.disableAutoCollapseAttr), "." + app.sidebar.class + " ." + app.sidebar.menu.class + " > ." + app.sidebar.menu.itemClass + "." + app.sidebar.menu.hasSubClass),
|
|
t = " > ." + app.sidebar.menu.submenu.class + " > ." + app.sidebar.menu.itemClass + "." + app.sidebar.menu.hasSubClass,
|
|
s = e + " > ." + app.sidebar.menu.itemLinkClass,
|
|
s = [].slice.call(document.querySelectorAll(s));
|
|
s && handleSidebarMenuToggle(s, a);
|
|
s = [].slice.call(document.querySelectorAll(e + t + " > ." + app.sidebar.menu.itemLinkClass));
|
|
s && handleSidebarMenuToggle(s, a);
|
|
s = [].slice.call(document.querySelectorAll(e + t + t + " > ." + app.sidebar.menu.itemLinkClass));
|
|
s && handleSidebarMenuToggle(s, a);
|
|
},
|
|
handleSidebarToggle = function () {
|
|
[].slice.call(document.querySelectorAll("[" + app.sidebar.mobile.toggleAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector("." + app.class).classList.add(app.sidebar.mobile.toggledClass), document.querySelector("." + app.class).classList.remove(app.sidebar.mobile.closedClass);
|
|
};
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.sidebar.mobile.dismissAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector("." + app.class).classList.remove(app.sidebar.mobile.toggledClass), document.querySelector("." + app.class).classList.add(app.sidebar.mobile.closedClass);
|
|
};
|
|
}),
|
|
[].slice.call(document.querySelectorAll("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")")).map(function (e) {
|
|
e.addEventListener("animationend", function () {
|
|
document.querySelector("." + app.class).classList.remove(app.sidebar.mobile.closedClass);
|
|
});
|
|
});
|
|
},
|
|
handleSidebarEndToggle = function () {
|
|
[].slice.call(document.querySelectorAll("[" + app.sidebarEnd.toggleAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault();
|
|
e = document.querySelector("." + app.class).classList;
|
|
e.contains(app.sidebarEnd.toggledClass) || e.contains(app.sidebarEnd.collapsedClass)
|
|
? e.contains(app.sidebarEnd.toggledClass)
|
|
? (e.remove(app.sidebarEnd.toggledClass), e.add(app.sidebarEnd.collapsedClass))
|
|
: (e.remove(app.sidebarEnd.collapsedClass), e.add(app.sidebarEnd.toggledClass))
|
|
: e.add(app.sidebarEnd.collapsedClass);
|
|
};
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.sidebarEnd.mobile.toggleAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector("." + app.class).classList.add(app.sidebarEnd.mobile.toggledClass), document.querySelector("." + app.class).classList.remove(app.sidebarEnd.mobile.closedClass);
|
|
};
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.sidebarEnd.mobile.dismissAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector("." + app.class).classList.remove(app.sidebarEnd.mobile.toggledClass), document.querySelector("." + app.class).classList.add(app.sidebarEnd.mobile.closedClass);
|
|
};
|
|
}),
|
|
[].slice.call(document.querySelectorAll("." + app.sidebar.class + "." + app.sidebarEnd.class)).map(function (e) {
|
|
e.addEventListener("animationend", function () {
|
|
document.querySelector("." + app.class).classList.remove(app.sidebarEnd.mobile.closedClass);
|
|
});
|
|
});
|
|
},
|
|
handleSidebarMinify = function () {
|
|
[].slice.call(document.querySelectorAll("[" + app.sidebar.minify.toggleAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = document.querySelector("." + app.class).classList,
|
|
a = !1;
|
|
e.contains(app.sidebar.minify.toggledClass) ? e.remove(app.sidebar.minify.toggledClass) : (e.add(app.sidebar.minify.toggledClass), (a = !0)),
|
|
document.querySelector(app.sidebar.floatSubmenu.id) && document.querySelector(app.sidebar.floatSubmenu.id).remove(),
|
|
setCookie(app.sidebar.minify.cookieName, a);
|
|
};
|
|
}),
|
|
getCookie(app.sidebar.minify.cookieName) && "true" == getCookie(app.sidebar.minify.cookieName) && document.querySelector("." + app.class).classList.add(app.sidebar.minify.toggledClass);
|
|
},
|
|
handlePageLoader = function () {
|
|
var e = document.querySelector("." + app.loader.class);
|
|
e &&
|
|
(e.addEventListener("animationend", function () {
|
|
e.classList.remove(app.loader.fadingClass), e.classList.add(app.loader.loadedClass);
|
|
}),
|
|
e.classList.add(app.loader.fadingClass));
|
|
},
|
|
handlePanelAction = function () {
|
|
var s;
|
|
[].slice.call(document.querySelectorAll("[" + app.panel.toggle.remove.attr + "]")).map(function (e) {
|
|
(e.onmouseover = function (e) {
|
|
!this.hasAttribute("data-tooltip-init") && bootstrap && ((s = new bootstrap.Tooltip(this, { title: app.panel.toggle.remove.tooltipText, placement: "bottom" })).show(), this.setAttribute("data-tooltip-init", !0));
|
|
}),
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector(".tooltip").remove(), this.closest("." + app.panel.class).remove();
|
|
});
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.panel.toggle.collapse.attr + "]")).map(function (e) {
|
|
(e.onmouseover = function (e) {
|
|
!this.hasAttribute("data-tooltip-init") && bootstrap && ((s = new bootstrap.Tooltip(this, { title: app.panel.toggle.collapse.tooltipText, placement: "bottom" })).show(), this.setAttribute("data-tooltip-init", !0));
|
|
}),
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), s.hide(), slideToggle(this.closest("." + app.panel.class).querySelector("." + app.panel.bodyClass));
|
|
});
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.panel.toggle.reload.attr + "]")).map(function (e) {
|
|
(e.onmouseover = function (e) {
|
|
!this.hasAttribute("data-tooltip-init") && bootstrap && ((s = new bootstrap.Tooltip(this, { title: app.panel.toggle.reload.tooltipText, placement: "bottom" })).show(), this.setAttribute("data-tooltip-init", !0));
|
|
}),
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), s && s.hide();
|
|
var a,
|
|
t = this.closest("." + app.panel.class);
|
|
t.classList.contains(app.panel.loadingClass) ||
|
|
((e = t.querySelector("." + app.panel.bodyClass)),
|
|
(a = document.createElement("div")).classList.add(app.panel.loader.class),
|
|
(a.innerHTML = app.panel.loader.html),
|
|
t.classList.add(app.panel.loadingClass),
|
|
e.appendChild(a),
|
|
setTimeout(() => {
|
|
t.classList.remove(app.panel.loadingClass), t.querySelector("." + app.panel.loader.class).remove();
|
|
}, 2e3));
|
|
});
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.panel.toggle.expand.attr + "]")).map(function (e) {
|
|
(e.onmouseover = function () {
|
|
!this.hasAttribute("data-tooltip-init") && bootstrap && ((s = new bootstrap.Tooltip(this, { title: app.panel.toggle.expand.tooltipText, placement: "bottom" })).show(), this.setAttribute("data-tooltip-init", !0));
|
|
}),
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), s && s.hide();
|
|
var e = this.closest("." + app.panel.class),
|
|
a = e.querySelector("." + app.panel.bodyClass);
|
|
a && (e.offsetTop, a.offsetTop),
|
|
document.body.classList.contains(app.panel.expandClass) && e.classList.contains(app.panel.expandClass)
|
|
? (document.body.classList.remove(app.panel.expandClass), e.classList.remove(app.panel.expandClass), e.removeAttribute("style"), a.removeAttribute("style"))
|
|
: (document.body.classList.add(app.panel.expandClass), this.closest("." + app.panel.class).classList.add(app.panel.expandClass));
|
|
});
|
|
});
|
|
},
|
|
handlePanelDraggable = function () {
|
|
var e, a, t;
|
|
jQuery &&
|
|
((e = $("." + app.panel.class + ":not([" + app.panel.draggable.disableAttr + "])").parent("[class*=col]")),
|
|
(a = "." + app.panel.headClass),
|
|
(t = app.panel.draggable.connectedTarget),
|
|
$(e).sortable({
|
|
handle: a,
|
|
connectWith: t,
|
|
stop: function (e, a) {
|
|
a.item.find("." + app.panel.titleClass).append(app.panel.draggable.spinnerHtml), handleSavePanelPosition(a.item);
|
|
},
|
|
}));
|
|
},
|
|
handelTooltipPopoverActivation = function () {
|
|
0 !== document.querySelectorAll("[" + app.bootstrap.tooltip.attr + "]").length &&
|
|
[].slice.call(document.querySelectorAll("[" + app.bootstrap.tooltip.attr + "]")).map(function (e) {
|
|
return new bootstrap.Tooltip(e);
|
|
}),
|
|
0 !== document.querySelectorAll("[" + app.bootstrap.popover.attr + "]").length &&
|
|
[].slice.call(document.querySelectorAll("[" + app.bootstrap.popover.attr + "]")).map(function (e) {
|
|
return new bootstrap.Popover(e);
|
|
});
|
|
},
|
|
handleScrollToTopButton = function () {
|
|
(document.body.onscroll = function () {
|
|
var e = this.scrollY,
|
|
a = document.querySelector("[" + app.scrollToTopBtn.toggleAttr + "]");
|
|
a && (e >= app.scrollToTopBtn.heightShow ? a.classList.contains(app.scrollToTopBtn.showClass) || a.classList.add(app.scrollToTopBtn.showClass) : a.classList.remove(app.scrollToTopBtn.showClass));
|
|
}),
|
|
[].slice.call(document.querySelectorAll("[" + app.scrollToTopBtn.toggleAttr + "]")).map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), window.scrollTo(0, 0);
|
|
};
|
|
});
|
|
},
|
|
handleThemePanel = function () {
|
|
var e = document.querySelector("[" + app.themePanel.toggleAttr + "]"),
|
|
a =
|
|
(e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = document.querySelector("." + app.themePanel.class),
|
|
a = !e.classList.contains(app.themePanel.activeClass);
|
|
e.classList.toggle(app.themePanel.activeClass), setCookie(app.themePanel.cookieName, a);
|
|
}),
|
|
[].slice.call(document.querySelectorAll("." + app.themePanel.class + " [" + app.themePanel.theme.toggleAttr + "]")));
|
|
a &&
|
|
a.map(function (s) {
|
|
s.onclick = function () {
|
|
for (var e = this.getAttribute(app.themePanel.theme.classAttr), a = 0; a < document.body.classList.length; a++) {
|
|
var t = document.body.classList[a];
|
|
-1 < t.search("theme-") && document.body.classList.remove(t);
|
|
}
|
|
e && document.body.classList.add(e),
|
|
[].slice.call(document.querySelectorAll("." + app.themePanel.class + " [" + app.themePanel.theme.toggleAttr + "]")).map(function (e) {
|
|
e != s ? e.closest("." + app.themePanel.themeListItemCLass).classList.remove(app.themePanel.theme.activeClass) : e.closest("." + app.themePanel.themeListItemCLass).classList.add(app.themePanel.theme.activeClass);
|
|
}),
|
|
setCookie(app.themePanel.theme.cookieName, e);
|
|
};
|
|
}),
|
|
(e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeHeader.toggleAttr + "]")) &&
|
|
(e.onchange = function () {
|
|
this.checked ? document.querySelector("." + app.header.class).setAttribute(app.darkMode.attr, app.darkMode.value) : document.querySelector("." + app.header.class).removeAttribute(app.darkMode.attr),
|
|
setCookie(app.themePanel.themeHeader.cookieName, !!this.checked);
|
|
}),
|
|
(e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeHeaderFixed.toggleAttr + "]")) &&
|
|
(e.onchange = function () {
|
|
this.checked
|
|
? document.querySelector("." + app.class).classList.add(app.themePanel.themeHeaderFixed.class)
|
|
: (document.querySelector("[" + app.themePanel.themeSidebarFixed.toggleAttr + "]").checked &&
|
|
!app.isMobile &&
|
|
(alert(app.themePanel.themeHeaderFixed.errorMessage),
|
|
(document.querySelector("[" + app.themePanel.themeSidebarFixed.toggleAttr + "]").checked = !1),
|
|
document.querySelector("[" + app.themePanel.themeSidebarFixed.toggleAttr + "]").onchange()),
|
|
document.querySelector("." + app.class).classList.remove(app.themePanel.themeHeaderFixed.class)),
|
|
setCookie(app.themePanel.themeHeaderFixed.cookieName, !!this.checked);
|
|
}),
|
|
(e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeSidebarGrid.toggleAttr + "]")) &&
|
|
(e.onchange = function () {
|
|
this.checked
|
|
? document.querySelector("." + app.sidebar.class).classList.add(app.themePanel.themeSidebarGrid.class)
|
|
: document.querySelector("." + app.sidebar.class).classList.remove(app.themePanel.themeSidebarGrid.class),
|
|
setCookie(app.themePanel.themeSidebarGrid.cookieName, this.checked ? app.themePanel.themeSidebarGrid.class : "");
|
|
}),
|
|
(e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeSidebarFixed.toggleAttr + "]")) &&
|
|
(e.onchange = function () {
|
|
var e = "." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ") [" + app.scrollBar.attr + "]";
|
|
app.isMobile
|
|
? ((this.checked = !0), alert(app.themePanel.themeSidebarFixed.mobileErrorMessage))
|
|
: (this.checked
|
|
? (document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeHeaderFixed.toggleAttr + "]").checked ||
|
|
(alert(app.themePanel.themeSidebarFixed.errorMessage),
|
|
(document.querySelector("[" + app.themePanel.themeHeaderFixed.toggleAttr + "]").checked = !0),
|
|
document.querySelector("[" + app.themePanel.themeHeaderFixed.toggleAttr + "]").onchange(),
|
|
document.querySelector("." + app.class).classList.add(app.themePanel.themeHeaderFixed.class)),
|
|
document.querySelector("." + app.class).classList.add(app.themePanel.themeSidebarFixed.class),
|
|
(document.querySelector(e).scrollbarInit = ""),
|
|
generateScrollbar(document.querySelector(e)))
|
|
: (document.querySelector("." + app.class).classList.remove(app.themePanel.themeSidebarFixed.class),
|
|
app.sidebar.scrollBar.dom.destroy(),
|
|
(app.sidebar.scrollBar.dom = ""),
|
|
document.querySelector(e).removeAttribute(app.scrollBar.initAttr)),
|
|
setCookie(app.themePanel.themeSidebarFixed.cookieName, !!this.checked));
|
|
}),
|
|
(e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeGradientEnabled.toggleAttr + "]")) &&
|
|
(e.onchange = function () {
|
|
this.checked ? document.querySelector("." + app.class).classList.add(app.themePanel.themeGradientEnabled.class) : document.querySelector("." + app.class).classList.remove(app.themePanel.themeGradientEnabled.class),
|
|
setCookie(app.themePanel.themeGradientEnabled.cookieName, this.checked ? app.themePanel.themeGradientEnabled.class : "");
|
|
}),
|
|
(a = [].slice.call(document.querySelectorAll("." + app.themePanel.class + " [" + app.themePanel.themeDarkMode.toggleAttr + "]"))).map(function (e) {
|
|
e.onchange = function () {
|
|
this.checked ? document.querySelector("html").setAttribute(app.darkMode.attr, app.darkMode.value) : document.querySelector("html").removeAttribute(app.darkMode.attr),
|
|
App.initVariable(),
|
|
setCookie(app.themePanel.themeDarkMode.cookieName, this.checked ? app.themePanel.themeDarkMode.class : ""),
|
|
document.dispatchEvent(new CustomEvent(app.darkMode.eventName));
|
|
};
|
|
}),
|
|
getCookie(app.themePanel.cookieName) && "true" == getCookie(app.themePanel.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.toggleAttr + "]")) && e.click(),
|
|
getCookie(app.themePanel.theme.cookieName) &&
|
|
(e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.theme.toggleAttr + "][" + app.themePanel.theme.classAttr + '="' + getCookie(app.themePanel.theme.cookieName) + '"]')) &&
|
|
e.click(),
|
|
getCookie(app.themePanel.themeDarkMode.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeDarkMode.toggleAttr + "]")) && ((e.checked = !0), e.onchange()),
|
|
getCookie(app.themePanel.themeGradientEnabled.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeGradientEnabled.toggleAttr + "]")) && ((e.checked = !0), e.onchange()),
|
|
getCookie(app.themePanel.themeSidebarGrid.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeSidebarGrid.toggleAttr + "]")) && ((e.checked = !0), e.onchange()),
|
|
"false" == getCookie(app.themePanel.themeSidebarFixed.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeSidebarFixed.toggleAttr + "]")) && ((e.checked = !1), e.onchange()),
|
|
"false" == getCookie(app.themePanel.themeHeaderFixed.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeHeaderFixed.toggleAttr + "]")) && ((e.checked = !1), e.onchange()),
|
|
"true" == getCookie(app.themePanel.themeHeader.cookieName) && (e = document.querySelector("." + app.themePanel.class + " [" + app.themePanel.themeHeader.toggleAttr + "]")) && ((e.checked = !0), e.onchange());
|
|
},
|
|
handleSavePanelPosition = function (a) {
|
|
var t;
|
|
jQuery &&
|
|
0 !== $("." + app.panel.sortable.class).length &&
|
|
((t = []),
|
|
$.when(
|
|
$("." + app.panel.sortable.class).each(function () {
|
|
var a,
|
|
e = $(this).find("[" + app.panel.sortable.attr + "]");
|
|
0 !== e.length
|
|
? ((a = []),
|
|
$(e).each(function () {
|
|
var e = $(this).attr(app.panel.sortable.attr);
|
|
a.push({ id: e });
|
|
}),
|
|
t.push(a))
|
|
: t.push([]),
|
|
0;
|
|
})
|
|
).done(function () {
|
|
var e = window.location.href;
|
|
(e = (e = e.split("?"))[0]),
|
|
localStorage.setItem(e, JSON.stringify(t)),
|
|
$(a)
|
|
.find("[" + app.panel.sortable.spinnerAttr + "]")
|
|
.delay(500)
|
|
.fadeOut(500, function () {
|
|
$(this).remove();
|
|
});
|
|
|
|
}));
|
|
},
|
|
handleLocalStorage = function () {
|
|
try {
|
|
var e, a, t;
|
|
"undefined" != typeof Storage && "undefined" != typeof localStorage && jQuery
|
|
? ((e = (e = (e = window.location.href).split("?"))[0]),
|
|
(a = localStorage.getItem(e)) &&
|
|
((a = JSON.parse(a)),
|
|
(t = 0),
|
|
$.when(
|
|
$("." + app.panel.class + ":not([" + app.panel.sortable.disableAttr + "])")
|
|
.parent("[" + app.panel.sortable.parentAttr + "]")
|
|
.each(function () {
|
|
var e = a[t],
|
|
l = $(this);
|
|
e &&
|
|
$.each(e, function (e, a) {
|
|
var t,
|
|
s = $("[" + app.panel.sortable.attr + '="' + a.id + '"]').not('[data-init="true"]');
|
|
0 !== $(s).length && ((t = $(s).clone()), $(s).remove(), $(l).append(t), $("[" + app.panel.sortable.attr + '="' + a.id + '"]').attr("data-init", "true"));
|
|
}),
|
|
t++;
|
|
})
|
|
).done(function () {
|
|
window.dispatchEvent(new CustomEvent(app.panel.localStorage.loadedEvent));
|
|
})))
|
|
: alert(app.panel.localStorage.notSupportMessage);
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
},
|
|
handleResetLocalStorage = function () {
|
|
var e = document.querySelector("[" + app.panel.localStorage.reset.attr + "]");
|
|
e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = document.createElement("div"),
|
|
a =
|
|
(e.classList.add("modal"),
|
|
e.classList.add("fade"),
|
|
e.setAttribute("data-modal-id", app.panel.localStorage.reset.modal.id),
|
|
(e.innerHTML =
|
|
' <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title"><i class="fa fa-redo me-1"></i> ' +
|
|
app.panel.localStorage.reset.modal.title +
|
|
'</h4> <button type="button" class="btn-close" ' +
|
|
app.bootstrap.modal.dismissAttr +
|
|
'></button> </div> <div class="modal-body"> <div class="alert alert-' +
|
|
app.panel.localStorage.reset.modal.alert +
|
|
' mb-0">' +
|
|
app.panel.localStorage.reset.modal.message +
|
|
'</div> </div> <div class="modal-footer"> <a href="javascript:;" class="btn btn-sm btn-default" ' +
|
|
app.bootstrap.modal.dismissAttr +
|
|
'><i class="fa fa-times me-1"></i> No</a> <a href="javascript:;" class="btn btn-sm btn-inverse" ' +
|
|
app.panel.localStorage.reset.modal.confirmResetAttr +
|
|
'><i class="fa fa-check me-1"></i> Yes</a> </div> </div> </div>'),
|
|
document.body.appendChild(e),
|
|
document.querySelector('[data-modal-id="' + app.panel.localStorage.reset.modal.id + '"]')),
|
|
e =
|
|
(new bootstrap.Modal(a).show(),
|
|
a.addEventListener(app.bootstrap.modal.event.hidden, function () {
|
|
a.remove();
|
|
}),
|
|
document.querySelector("[" + app.panel.localStorage.reset.modal.confirmResetAttr + "]"));
|
|
e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault();
|
|
e = window.location.href;
|
|
(e = (e = e.split("?"))[0]), localStorage.removeItem(e), location.reload();
|
|
});
|
|
});
|
|
},
|
|
handleUnlimitedTabsRender = function () {
|
|
function a(e, a) {
|
|
var t = e.closest("." + app.unlimitedTabs.class),
|
|
s = window.getComputedStyle(document.body),
|
|
e = window.getComputedStyle(t.querySelector("." + app.bootstrap.nav.tabs.class)),
|
|
l = "rtl" == s.getPropertyValue("direction") ? "margin-right" : "margin-left",
|
|
o = parseInt(e.getPropertyValue(l)),
|
|
r = t.clientWidth,
|
|
n = 0,
|
|
e = [].slice.call(t.querySelectorAll("li"));
|
|
switch (
|
|
(e &&
|
|
e.map(function (e) {
|
|
e.classList.contains(app.unlimitedTabs.buttonNext.class) || e.classList.contains(app.unlimitedTabs.buttonPrev.class) || (n += e.clientWidth);
|
|
}),
|
|
a)
|
|
) {
|
|
case "next":
|
|
var i = -1 * o + (r = r - 85) + r,
|
|
p = 0,
|
|
c = !1;
|
|
(n = n - 85) <= i ? ((p = n - r), (c = !0)) : i < n && (p = i - r),
|
|
((d = t.querySelector("." + app.bootstrap.nav.tabs.class)).style.transitionProperty = "height, margin, padding"),
|
|
(d.style.transitionDuration = app.animation.speed + "ms"),
|
|
"rtl" != s.getPropertyValue("direction")
|
|
? ((d.style.marginLeft = "-" + p + "px"), c && t.classList.remove(app.unlimitedTabs.overflowRight.class), t.classList.add(app.unlimitedTabs.overflowLeft.class))
|
|
: ((d.style.marginRight = "-" + p + "px"), c && t.classList.remove(app.unlimitedTabs.overflowLeft.class), t.classList.add(app.unlimitedTabs.overflowRight.class)),
|
|
setTimeout(function () {
|
|
(d.style.transitionProperty = ""), (d.style.transitionDuration = "");
|
|
}, app.animation.speed);
|
|
break;
|
|
case "prev":
|
|
var d,
|
|
n = n - 85,
|
|
i = !1;
|
|
(p = (p = -1 * o - (r = r - 85)) <= 0 ? 0 : p) <= 0 && (i = !0),
|
|
((d = t.querySelector("." + app.bootstrap.nav.tabs.class)).style.transitionProperty = "height, margin, padding"),
|
|
(d.style.transitionDuration = app.animation.speed + "ms"),
|
|
"rtl" != s.getPropertyValue("direction")
|
|
? ((d.style.marginLeft = "-" + p + "px"), t.classList.add(app.unlimitedTabs.overflowRight.class), i && t.classList.remove(app.unlimitedTabs.overflowLeft.class))
|
|
: ((d.style.marginRight = "-" + p + "px"), t.classList.add(app.unlimitedTabs.overflowLeft.class), i && t.classList.remove(app.unlimitedTabs.overflowRight.class)),
|
|
setTimeout(function () {
|
|
(d.style.transitionProperty = ""), (d.style.transitionDuration = "");
|
|
}, app.animation.speed);
|
|
}
|
|
}
|
|
function t() {
|
|
var e = [].slice.call(document.querySelectorAll("." + app.unlimitedTabs.class));
|
|
e &&
|
|
e.map(function (e) {
|
|
var a, t, s, l, o, r, n, i, p;
|
|
(e = e),
|
|
(a = 0),
|
|
(s = "." + app.bootstrap.nav.tabs.itemClass + " ." + app.bootstrap.nav.tabs.activeClass),
|
|
e.querySelector("." + app.bootstrap.nav.tabs.itemClass) && (s = e.querySelector("." + app.bootstrap.nav.tabs.itemClass + " ." + app.bootstrap.nav.tabs.activeClass).closest("." + app.bootstrap.nav.tabs.itemClass)),
|
|
(l = window.getComputedStyle(document.querySelector("body"))),
|
|
(o = "rtl" == l.getPropertyValue("direction") ? "margin-right" : "margin-left"),
|
|
(r = window.getComputedStyle(e)),
|
|
parseInt(r.getPropertyValue(o)),
|
|
(r = e.clientWidth),
|
|
(n = ("object" == typeof s ? s : e.querySelector(s)).clientWidth),
|
|
(o = -1 < a ? a : app.animation.speed),
|
|
(i = 0),
|
|
(s = [].slice.call(e.querySelectorAll("." + app.bootstrap.nav.tabs.itemClass))),
|
|
(p = !1),
|
|
s &&
|
|
s.map(function (e) {
|
|
(i += e.clientWidth), p || (n += e.clientWidth), e.querySelector(".nav-link").classList.contains("active") && (p = !0);
|
|
}),
|
|
r <= n &&
|
|
((a = n - r),
|
|
i != n && (a += 40),
|
|
((t = e.querySelector("." + app.bootstrap.nav.tabs.class)).style.transitionProperty = "height, margin, padding"),
|
|
(t.style.transitionDuration = o + "ms"),
|
|
"rtl" == l.getPropertyValue("direction") ? (t.style.marginRight = "-" + a + "px") : (t.style.marginLeft = "-" + a + "px"),
|
|
setTimeout(function () {
|
|
(t.style.transitionProperty = ""), (t.style.transitionDuration = "");
|
|
}, o)),
|
|
n != i && r <= i ? e.classList.add(app.unlimitedTabs.overflowRight.class) : e.classList.remove(app.unlimitedTabs.overflowRight.class),
|
|
r <= n && r <= i ? e.classList.add(app.unlimitedTabs.overflowLeft.class) : e.classList.remove(app.unlimitedTabs.overflowLeft.class);
|
|
});
|
|
}
|
|
var e = [].slice.call(document.querySelectorAll("[" + app.unlimitedTabs.buttonNext.toggleAttr + "]"));
|
|
e &&
|
|
e.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), a(this, "next");
|
|
};
|
|
}),
|
|
(e = [].slice.call(document.querySelectorAll("[" + app.unlimitedTabs.buttonPrev.toggleAttr + "]"))) &&
|
|
e.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), a(this, "prev");
|
|
};
|
|
}),
|
|
window.addEventListener("resize", function () {
|
|
var e = document.querySelector("." + app.unlimitedTabs.class + " ." + app.bootstrap.nav.tabs.class);
|
|
e && (e.removeAttribute("style"), t());
|
|
}),
|
|
t();
|
|
},
|
|
handleUnlimitedTopMenuRender = function () {
|
|
function a(e, a) {
|
|
var t = e.closest("." + app.topMenu.menu.class),
|
|
e = window.getComputedStyle(t),
|
|
s = window.getComputedStyle(document.querySelector("body")),
|
|
l = "rtl" == s.getPropertyValue("direction") ? "margin-right" : "margin-left",
|
|
o = parseInt(e.getPropertyValue(l)),
|
|
r = document.querySelector("." + app.topMenu.class).clientWidth - 2 * document.querySelector("." + app.topMenu.class).clientHeight,
|
|
n = 0,
|
|
i = 0,
|
|
e = t.querySelector(".menu-control-start"),
|
|
l = e ? e.clientWidth : 0,
|
|
p = t.querySelector(".menu-control-end"),
|
|
c = l + (e ? p.clientWidth : 0),
|
|
l = [].slice.call(t.querySelectorAll("." + app.topMenu.menu.itemClass));
|
|
switch (
|
|
(l &&
|
|
l.map(function (e) {
|
|
e.classList.contains(app.topMenu.control.class) || (n += e.clientWidth);
|
|
}),
|
|
a)
|
|
) {
|
|
case "next":
|
|
(d = n + o - r) <= r
|
|
? ((i = d - o - c),
|
|
setTimeout(function () {
|
|
t.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.remove("show");
|
|
}, app.animation.speed))
|
|
: (i = r - o - c),
|
|
0 !== i &&
|
|
((t.style.transitionProperty = "height, margin, padding"),
|
|
(t.style.transitionDuration = app.animation.speed + "ms"),
|
|
"rtl" != s.getPropertyValue("direction") ? (t.style.marginLeft = "-" + i + "px") : (t.style.marginRight = "-" + i + "px"),
|
|
setTimeout(function () {
|
|
(t.style.transitionProperty = ""), (t.style.transitionDuration = ""), t.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.add("show");
|
|
}, app.animation.speed));
|
|
break;
|
|
case "prev":
|
|
var d,
|
|
i = (d = -o) <= r ? (t.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.remove("show"), 0) : d - r + c;
|
|
(t.style.transitionProperty = "height, margin, padding"),
|
|
(t.style.transitionDuration = app.animation.speed + "ms"),
|
|
"rtl" != s.getPropertyValue("direction") ? (t.style.marginLeft = "-" + i + "px") : (t.style.marginRight = "-" + i + "px"),
|
|
setTimeout(function () {
|
|
(t.style.transitionProperty = ""), (t.style.transitionDuration = ""), t.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.add("show");
|
|
}, app.animation.speed);
|
|
}
|
|
}
|
|
function t() {
|
|
var e,
|
|
a,
|
|
t,
|
|
s,
|
|
l,
|
|
o,
|
|
r,
|
|
n,
|
|
i = document.querySelector("." + app.topMenu.class + " ." + app.topMenu.menu.class);
|
|
i &&
|
|
((a = window.getComputedStyle(i)),
|
|
(n = "rtl" == (e = window.getComputedStyle(document.body)).getPropertyValue("direction") ? "margin-right" : "margin-left"),
|
|
parseInt(a.getPropertyValue(n)),
|
|
(a = document.querySelector("." + app.topMenu.class).clientWidth),
|
|
(s = t = 0),
|
|
(n = i.querySelector(".menu-control-start")) && n.clientWidth,
|
|
(l = i.querySelector(".menu-control-end")),
|
|
(n = n ? l.clientWidth : 0),
|
|
(l = 0),
|
|
(r = [].slice.call(document.querySelectorAll("." + app.topMenu.class + " ." + app.topMenu.menu.class + " > ." + app.topMenu.menu.itemClass))) &&
|
|
((o = !1),
|
|
r.map(function (e) {
|
|
e.classList.contains("menu-control") || ((s += e.clientWidth), o || (t += e.clientWidth), e.classList.contains("active") && (o = !0));
|
|
})),
|
|
(r = i.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class)),
|
|
t != s && a <= s ? (r.classList.add(app.topMenu.control.showClass), (l += n)) : r.classList.remove(app.topMenu.control.showClass),
|
|
(r = i.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class)),
|
|
a <= t && a <= s ? r.classList.add(app.topMenu.control.showClass) : r.classList.remove(app.topMenu.control.showClass),
|
|
a <= t) &&
|
|
((n = t - a + l), "rtl" != e.getPropertyValue("direction") ? (i.style.marginLeft = "-" + n + "px") : (i.style.marginRight = "-" + n + "px"));
|
|
}
|
|
var e = document.querySelector("[" + app.topMenu.control.buttonNext.toggleAttr + "]");
|
|
function s(e) {
|
|
let n = document.querySelector(e);
|
|
if (n) {
|
|
let a = n.querySelector(".menu");
|
|
e = a.querySelectorAll(".menu-item:not(.menu-control)");
|
|
let t,
|
|
s,
|
|
l,
|
|
o = 0,
|
|
r = 0;
|
|
e.forEach((e) => {
|
|
o += e.offsetWidth;
|
|
}),
|
|
n.addEventListener("mousedown", (e) => {
|
|
(l = !0), (t = e.pageX), (s = a.style.marginLeft ? parseInt(a.style.marginLeft) : 0), (r = n.offsetWidth - o);
|
|
}),
|
|
n.addEventListener("touchstart", (e) => {
|
|
l = !0;
|
|
e = e.targetTouches[0];
|
|
(t = e.pageX), (s = a.style.marginLeft ? parseInt(a.style.marginLeft) : 0), (r = n.offsetWidth - o);
|
|
}),
|
|
n.addEventListener("mouseup", () => {
|
|
l = !1;
|
|
}),
|
|
n.addEventListener("touchend", () => {
|
|
l = !1;
|
|
}),
|
|
n.addEventListener("mousemove", (e) => {
|
|
t &&
|
|
l &&
|
|
(window.innerWidth < app.breakpoints.md ||
|
|
(e.preventDefault(),
|
|
(e = e.pageX - t),
|
|
(e = s + e) <= r
|
|
? ((e = r), a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.remove("show"))
|
|
: a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.add("show"),
|
|
o < n.offsetWidth && a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.remove("show"),
|
|
0 < r && a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.remove("show"),
|
|
0 < e
|
|
? ((e = 0), a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.remove("show"))
|
|
: a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.add("show"),
|
|
(a.style.marginLeft = e + "px")));
|
|
}),
|
|
n.addEventListener("touchmove", (e) => {
|
|
t &&
|
|
l &&
|
|
(window.innerWidth < app.breakpoints.md ||
|
|
(e.preventDefault(),
|
|
(e = e.targetTouches[0].pageX - t),
|
|
(e = s + e) <= r
|
|
? ((e = r), a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.remove("show"))
|
|
: a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.add("show"),
|
|
o < n.offsetWidth && a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.remove("show"),
|
|
0 < r && a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonNext.class).classList.remove("show"),
|
|
0 < e
|
|
? ((e = 0), a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.remove("show"))
|
|
: a.querySelector("." + app.topMenu.control.class + "." + app.topMenu.control.buttonPrev.class).classList.add("show"),
|
|
(a.style.marginLeft = e + "px")));
|
|
});
|
|
}
|
|
}
|
|
e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), a(this, "next");
|
|
}),
|
|
(e = document.querySelector("[" + app.topMenu.control.buttonPrev.toggleAttr + "]")) &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), a(this, "prev");
|
|
}),
|
|
window.addEventListener("resize", function () {
|
|
var e;
|
|
window.innerWidth >= app.breakpoints.md &&
|
|
((e = document.querySelector("." + app.topMenu.class)) && e.removeAttribute("style"),
|
|
(e = document.querySelector("." + app.topMenu.class + " ." + app.topMenu.menu.class)) && e.removeAttribute("style"),
|
|
(e = document.querySelectorAll("." + app.topMenu.class + " ." + app.topMenu.menu.submenu.class)) &&
|
|
e.forEach((e) => {
|
|
e.removeAttribute("style");
|
|
}),
|
|
t(),
|
|
s("." + app.topMenu.class));
|
|
}),
|
|
window.innerWidth >= app.breakpoints.md && (t(), s("." + app.topMenu.class));
|
|
},
|
|
handleTopMenuToggle = function (t, s = !1) {
|
|
t.map(function (e) {
|
|
e.onclick = function (e) {
|
|
var a;
|
|
e.preventDefault(),
|
|
(!s || document.body.clientWidth < 768) &&
|
|
((a = this.nextElementSibling),
|
|
t.map(function (e) {
|
|
e = e.nextElementSibling;
|
|
e !== a && (slideUp(e), e.closest("." + app.topMenu.menu.itemClass).classList.remove(app.topMenu.menu.expandClass), e.closest("." + app.topMenu.menu.itemClass).classList.add(app.topMenu.menu.closedClass));
|
|
}),
|
|
slideToggle(a));
|
|
};
|
|
});
|
|
},
|
|
handleTopMenuSubMenu = function () {
|
|
var e = "." + app.topMenu.class + " ." + app.topMenu.menu.class + " > ." + app.topMenu.menu.itemClass + "." + app.topMenu.menu.hasSubClass,
|
|
a = " > ." + app.topMenu.menu.submenu.class + " > ." + app.topMenu.menu.itemClass + "." + app.topMenu.menu.hasSubClass,
|
|
t = e + " > ." + app.topMenu.menu.itemLinkClass,
|
|
t = [].slice.call(document.querySelectorAll(t));
|
|
handleTopMenuToggle(t, !0);
|
|
t = [].slice.call(document.querySelectorAll(e + a + " > ." + app.topMenu.menu.itemLinkClass));
|
|
handleTopMenuToggle(t);
|
|
t = [].slice.call(document.querySelectorAll(e + a + a + " > ." + app.topMenu.menu.itemLinkClass));
|
|
handleTopMenuToggle(t),
|
|
window.addEventListener("resize", function () {
|
|
[].slice.call(document.querySelectorAll("." + app.topMenu.class + " ." + app.topMenu.menu.submenu.class)).map(function (e) {
|
|
e.removeAttribute("style");
|
|
});
|
|
});
|
|
},
|
|
handleTopMenuMobileToggle = function () {
|
|
var e = document.querySelector("[" + app.topMenu.mobile.toggleAttr + "]");
|
|
e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), slideToggle(document.querySelector("." + app.topMenu.class));
|
|
}),
|
|
window.addEventListener("resize", function () {
|
|
var e = document.querySelector("." + app.topMenu.class);
|
|
e && e.removeAttribute("style");
|
|
});
|
|
},
|
|
handlePageScrollClass = function () {
|
|
function e() {
|
|
var e = document.querySelector("." + app.class);
|
|
0 < window.scrollY ? e.classList.add(app.header.hasScrollClass) : e.classList.remove(app.header.hasScrollClass);
|
|
}
|
|
window.addEventListener("scroll", function () {
|
|
e();
|
|
}),
|
|
e();
|
|
},
|
|
handleToggleNavProfile = function () {
|
|
var e = document.querySelector("[" + app.sidebar.profile.toggleAttr + "]");
|
|
e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = document.querySelector("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")"),
|
|
a = this.closest("." + app.sidebar.profile.class),
|
|
t = document.querySelector(this.getAttribute(app.sidebar.profile.targetAttr)),
|
|
e = e && e.getAttribute(app.sidebar.menu.disableAnimationAttr) ? 0 : app.sidebar.menu.animationTime;
|
|
t && ("block" == t.style.display ? a.classList.remove(app.sidebar.menu.activeClass) : a.classList.add(app.sidebar.menu.activeClass), slideToggle(t, e), t.classList.toggle(app.sidebar.menu.expandClass));
|
|
});
|
|
},
|
|
handleSidebarScrollMemory = function () {
|
|
if (!app.isMobile)
|
|
try {
|
|
var e, a;
|
|
"undefined" != typeof Storage &&
|
|
"undefined" != typeof localStorage &&
|
|
(e = document.querySelector("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ") [" + app.scrollBar.attr + "]")) &&
|
|
(e.addEventListener("scroll", function (e) {
|
|
localStorage.setItem(app.sidebar.scrollBar.localStorage, e.target.scrollTop);
|
|
}),
|
|
(a = localStorage.getItem(app.sidebar.scrollBar.localStorage))) &&
|
|
(e.scrollTop = a);
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
},
|
|
handleGetHiddenMenuHeight = function (e) {
|
|
e.setAttribute("style", "position: absolute; visibility: hidden; display: block !important");
|
|
var a = e.clientHeight;
|
|
return e.removeAttribute("style"), a;
|
|
},
|
|
handleSidebarMinifyFloatMenuClick = function () {
|
|
var e = [].slice.call(document.querySelectorAll(app.sidebar.floatSubmenu.id + " ." + app.sidebar.menu.itemClass + "." + app.sidebar.menu.hasSubClass + " > ." + app.sidebar.menu.itemLinkClass));
|
|
e &&
|
|
e.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = this.closest("." + app.sidebar.menu.itemClass).querySelector("." + app.sidebar.menu.submenu.class),
|
|
a = getComputedStyle(e),
|
|
d = "none" != a.getPropertyValue("display"),
|
|
u = "none" == a.getPropertyValue("display"),
|
|
t =
|
|
(slideToggle(e),
|
|
setInterval(function () {
|
|
var e = document.querySelector(app.sidebar.floatSubmenu.id),
|
|
a = document.querySelector(app.sidebar.floatSubmenu.arrow.id),
|
|
t = document.querySelector(app.sidebar.floatSubmenu.line.id),
|
|
s = e.clientHeight,
|
|
l = e.getBoundingClientRect(),
|
|
o = e.getAttribute("data-offset-top"),
|
|
r = e.getAttribute("data-menu-offset-top"),
|
|
l = l.top,
|
|
n = document.body.clientHeight;
|
|
if ((d && o < l && ((e.style.top = (l = o < l ? o : l) + "px"), (e.style.bottom = "auto"), (a.style.top = "20px"), (a.style.bottom = "auto"), (t.style.top = "20px"), (t.style.bottom = "auto")), u)) {
|
|
n - l < s && ((o = n - r - 22), (e.style.top = "auto"), (e.style.bottom = 0), (a.style.top = "auto"), (a.style.bottom = o + "px"), (t.style.top = "20px"), (t.style.bottom = o + "px"));
|
|
var i = document.querySelector(app.sidebar.floatSubmenu.id + " ." + app.sidebar.floatSubmenu.class);
|
|
if (n < s && i) for (var p = app.sidebar.floatSubmenu.overflow.class.split(" "), c = 0; c < p.length; c++) i.classList.add(p[c]);
|
|
}
|
|
}, 1));
|
|
setTimeout(function () {
|
|
clearInterval(t);
|
|
}, app.animation.speed);
|
|
};
|
|
}),
|
|
handleAjaxMode.initToggler();
|
|
},
|
|
handleSidebarMinifyFloatMenu = function () {
|
|
var e = [].slice.call(document.querySelectorAll("." + app.sidebar.class + " ." + app.sidebar.menu.class + " > ." + app.sidebar.menu.itemClass + "." + app.sidebar.menu.hasSubClass + " > ." + app.sidebar.menu.itemLinkClass));
|
|
e &&
|
|
e.map(function (e) {
|
|
(e.onmouseenter = function () {
|
|
var e = document.querySelector("." + app.class);
|
|
if (e && e.classList.contains(app.sidebar.minify.toggledClass)) {
|
|
clearTimeout(app.sidebar.floatSubmenu.timeout);
|
|
var a = this.closest("." + app.sidebar.menu.itemClass).querySelector("." + app.sidebar.menu.submenu.class);
|
|
if (app.sidebar.floatSubmenu.dom != this || !document.querySelector(app.sidebar.floatSubmenu.id)) {
|
|
app.sidebar.floatSubmenu.dom = this;
|
|
var t = a.innerHTML;
|
|
if (t) {
|
|
var s = getComputedStyle(document.body),
|
|
l = document.querySelector(app.sidebar.id),
|
|
o = l.getBoundingClientRect(),
|
|
r = parseInt(l.clientWidth),
|
|
o = e.classList.contains(app.sidebarEnd.class) || "rtl" == s.getPropertyValue("direction") ? document.body.clientWidth - o.left : o.left + r,
|
|
r = handleGetHiddenMenuHeight(a),
|
|
a = this.getBoundingClientRect().top,
|
|
n = e.classList.contains(app.sidebarEnd.class) || "rtl" == s.getPropertyValue("direction") ? "auto" : o,
|
|
s = e.classList.contains(app.sidebarEnd.class) || "rtl" == s.getPropertyValue("direction") ? o : "auto",
|
|
o = l.getAttribute(app.darkMode.attr) == app.darkMode.value,
|
|
l = document.body.clientHeight;
|
|
if (document.querySelector(app.sidebar.floatSubmenu.id)) {
|
|
var i = document.querySelector(app.sidebar.floatSubmenu.id),
|
|
p = document.querySelector(app.sidebar.floatSubmenu.id + " ." + app.sidebar.floatSubmenu.class);
|
|
if (l < r && p) for (var c = app.sidebar.floatSubmenu.overflow.class.split(" "), d = 0; d < c.length; d++) p.classList.add(c[d]);
|
|
i.setAttribute("data-offset-top", a), i.setAttribute("data-menu-offset-top", a), (p.innerHTML = t);
|
|
} else {
|
|
var i = "",
|
|
u = (l < r && (i = app.sidebar.floatSubmenu.overflow.class), document.createElement("div")),
|
|
o =
|
|
(o && u.setAttribute(app.darkMode.attr, app.darkMode.value),
|
|
u.setAttribute("id", app.sidebar.floatSubmenu.id.replace("#", "")),
|
|
u.setAttribute("class", app.sidebar.floatSubmenu.container.class),
|
|
u.setAttribute("data-offset-top", a),
|
|
u.setAttribute("data-menu-offset-top", a),
|
|
(u.innerHTML =
|
|
'\t<div class="' +
|
|
app.sidebar.floatSubmenu.arrow.class +
|
|
'" id="' +
|
|
app.sidebar.floatSubmenu.arrow.id.replace("#", "") +
|
|
'"></div>\t<div class="' +
|
|
app.sidebar.floatSubmenu.line.class +
|
|
'" id="' +
|
|
app.sidebar.floatSubmenu.line.id.replace("#", "") +
|
|
'"></div>\t<div class="' +
|
|
app.sidebar.floatSubmenu.class +
|
|
" " +
|
|
i +
|
|
'">' +
|
|
t +
|
|
"</div>"),
|
|
e.appendChild(u),
|
|
document.getElementById(app.sidebar.floatSubmenu.id.replace("#", "")));
|
|
(o.onmouseover = function () {
|
|
clearTimeout(app.sidebar.floatSubmenu.timeout);
|
|
}),
|
|
(o.onmouseout = function () {
|
|
app.sidebar.floatSubmenu.timeout = setTimeout(() => {
|
|
document.querySelector(app.sidebar.floatSubmenu.id).remove();
|
|
}, app.animation.speed);
|
|
});
|
|
}
|
|
(r = document.querySelector(app.sidebar.floatSubmenu.id).clientHeight),
|
|
(p = document.querySelector(app.sidebar.floatSubmenu.id)),
|
|
(i = document.querySelector(app.sidebar.floatSubmenu.arrow.id)),
|
|
(t = document.querySelector(app.sidebar.floatSubmenu.line.id));
|
|
r < l - a
|
|
? (p && ((p.style.top = a + "px"), (p.style.left = n + "px"), (p.style.bottom = "auto"), (p.style.right = s + "px")),
|
|
i && ((i.style.top = "20px"), (i.style.bottom = "auto")),
|
|
t && ((t.style.top = "20px"), (t.style.bottom = "auto")))
|
|
: ((e = l - a - 21),
|
|
p && ((p.style.top = "auto"), (p.style.left = n + "px"), (p.style.bottom = 0), (p.style.right = s + "px")),
|
|
i && ((i.style.top = "auto"), (i.style.bottom = e + "px")),
|
|
t && ((t.style.top = "20px"), (t.style.bottom = e + "px"))),
|
|
handleSidebarMinifyFloatMenuClick();
|
|
} else document.querySelector(app.sidebar.floatSubmenu.line.id).remove(), (app.sidebar.floatSubmenu.dom = "");
|
|
}
|
|
}
|
|
}),
|
|
(e.onmouseleave = function () {
|
|
var e = document.querySelector("." + app.class);
|
|
e &&
|
|
e.classList.contains(app.sidebar.minify.toggledClass) &&
|
|
(app.sidebar.floatSubmenu.timeout = setTimeout(() => {
|
|
var e = document.querySelector(app.sidebar.floatSubmenu.line.id);
|
|
e && e.remove(), (app.sidebar.floatSubmenu.dom = "");
|
|
}, 250));
|
|
});
|
|
});
|
|
},
|
|
handleAjaxMode = (() => {
|
|
var r;
|
|
return {
|
|
emptyHtml: "",
|
|
init: function (e) {
|
|
e && (r = e), this.initDefaultUrl(), this.initHashChange(), this.initToggler();
|
|
},
|
|
initDefaultUrl: function () {
|
|
var e;
|
|
(this.emptyHtml = r && r.emptyHtml ? r.emptyHtml : app.ajax.error.html),
|
|
(this.defaultUrl = r && r.ajaxDefaultUrl ? r.ajaxDefaultUrl : ""),
|
|
(this.defaultUrl = window.location.hash || this.defaultUrl),
|
|
"" === this.defaultUrl ? (e = document.querySelector("." + app.content.class)) && (e.innerHTML = emptyHtml) : this.renderAjax(this.defaultUrl, "", !0);
|
|
},
|
|
initHashChange: function () {
|
|
window.addEventListener("hashchange", function () {
|
|
window.location.hash ? handleAjaxMode.renderAjax(window.location.hash, "", !0) : handleAjaxMode.renderAjax(defaultUrl, "", !0);
|
|
});
|
|
},
|
|
initToggler: function () {
|
|
var e = [].slice.call(document.querySelectorAll("[" + app.ajax.attr + "]"));
|
|
e &&
|
|
e.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault(), handleAjaxMode.renderAjax(this.getAttribute("href"), this);
|
|
};
|
|
});
|
|
},
|
|
emptyElement: function () {
|
|
var e = document.querySelector(app.ajax.emptyElement);
|
|
e && (e.innerHTML = "");
|
|
},
|
|
clearElement: function () {
|
|
for (var e = app.ajax.clearElement.split(","), a = 0; a < e.length; a++) {
|
|
var t = [].slice.call(document.querySelectorAll(e[a]));
|
|
t &&
|
|
t.map(function (e) {
|
|
e.remove();
|
|
});
|
|
}
|
|
var s = document.getElementById(app.sidebar.floatSubmenu.id);
|
|
if ((s && s.remove(), jQuery && $.fn.DataTable))
|
|
try {
|
|
$(".dataTable").DataTable().destroy();
|
|
} catch (e) {}
|
|
(s = document.querySelector("." + app.class)) && s.classList.contains(app.sidebar.mobile.toggledClass) && s.classList.remove(app.sidebar.mobile.toggledClass);
|
|
},
|
|
checkSidebarActive: function (e) {
|
|
var a,
|
|
t,
|
|
e = document.querySelector(app.sidebar.id + " [" + app.ajax.attr + '][href="' + e + '"]');
|
|
e &&
|
|
((t = [].slice.call(document.querySelectorAll(app.sidebar.id + " ." + app.sidebar.menu.itemClass))) &&
|
|
t.map(function (e) {
|
|
e.classList.remove(app.sidebar.menu.activeClass);
|
|
}),
|
|
(a = e.closest("." + app.sidebar.menu.itemClass)) && a.classList.add(app.sidebar.menu.activeClass),
|
|
(t = getParents(e))) &&
|
|
t.map(function (e) {
|
|
e.classList && e.classList.contains(app.sidebar.menu.itemClass) && e.classList.add(app.sidebar.menu.activeClass);
|
|
});
|
|
},
|
|
checkPushState: function (e) {
|
|
var e = e.replace("#", ""),
|
|
a = window.navigator.userAgent.indexOf("MSIE ");
|
|
a && 0 < a && a < 9 ? (window.location.href = e) : history.pushState("", "", "#" + e);
|
|
},
|
|
checkClearOption: function () {
|
|
app.ajax.clearOption && (App.clearPageOption(app.ajax.clearOption), (app.ajax.clearOption = ""));
|
|
},
|
|
checkLoading: function (e) {
|
|
var a;
|
|
e
|
|
? ((e = document.querySelector(app.ajax.loader.id)) && e.remove(), (a = document.querySelector("." + app.content.class)) && a.classList.remove("position-relative"), document.body.classList.remove(app.ajax.loader.class))
|
|
: !document.querySelector(app.ajax.loader.id) &&
|
|
(document.body.classList.add(app.ajax.loader.class), (a = document.querySelector("." + app.content.class))) &&
|
|
((e = document.createElement("div")).setAttribute("id", app.ajax.loader.id.replace("#", "")),
|
|
e.setAttribute("class", "position-absolute top-0 bottom-0 start-0 end-0 bg-light bg-opacity-75"),
|
|
(e.style.zIndex = 9999),
|
|
(e.innerHTML = app.ajax.loader.html),
|
|
a.classList.add("position-relative"),
|
|
a.appendChild(e));
|
|
},
|
|
renderAjax: function (e, a, t) {
|
|
Pace && Pace.restart(),
|
|
handleAjaxMode.checkLoading(!1),
|
|
handleAjaxMode.clearElement(),
|
|
handleAjaxMode.emptyElement(),
|
|
handleAjaxMode.checkSidebarActive(e),
|
|
handleAjaxMode.checkClearOption(),
|
|
t || handleAjaxMode.checkPushState(e);
|
|
var s,
|
|
l,
|
|
o = document.querySelector("." + app.content.class);
|
|
o &&
|
|
((t = e.replace("#", "")),
|
|
(e = r && r.ajaxType ? r.ajaxType : "GET"),
|
|
(s = r && r.ajaxDataType ? r.ajaxDataType : "html"),
|
|
a && ((s = a.getAttribute("data-type") ? a.getAttribute("data-type") : s), (targetDataDataType = a.getAttribute("data-data-type") ? a.getAttribute("data-data-type") : s)),
|
|
((l = new XMLHttpRequest()).onreadystatechange = function () {
|
|
l.readyState == XMLHttpRequest.DONE &&
|
|
(200 == l.status ? setInnerHTML(o, l.responseText) : 400 == l.status ? (console.log("There was an error 400"), setInnerHTML(o, emptyHtml)) : console.log("something else other than 200 was returned"),
|
|
handleAjaxMode.checkLoading(!0),
|
|
(document.body.scrollTop = 0),
|
|
App.initComponent());
|
|
}),
|
|
l.open(e, t, !0),
|
|
l.send());
|
|
},
|
|
};
|
|
})(),
|
|
handleSetPageOption = function (e) {
|
|
var a,
|
|
t = document.querySelector("." + app.class);
|
|
if (t) {
|
|
if ((e.appContentFullHeight && t.classList.add(app.content.fullHeight.class), e.appSidebarLight)) {
|
|
var s = document.querySelector("." + app.class + " ." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")");
|
|
if (!s) return;
|
|
s.removeAttribute(app.darkMode.attr);
|
|
}
|
|
if (
|
|
(e.appSidebarEnd && t.classList.add(app.layout.sidebarEnd.class),
|
|
e.appSidebarWide && t.classList.add(app.layout.sidebarWide.class),
|
|
e.appSidebarMinified && t.classList.add(app.layout.sidebarMinified.class),
|
|
e.appSidebarTwo &&
|
|
(t.classList.add(app.layout.sidebarTwo.class),
|
|
t.classList.add(app.sidebarEnd.toggledClass),
|
|
(a = document.querySelector("." + app.header.class + " [" + app.sidebarEnd.mobile.toggleAttr + "]")) && a.classList.remove(app.helper.display.none),
|
|
(a = document.querySelector("." + app.header.class + " ." + app.header.brand.class))) &&
|
|
a.classList.remove(app.helper.margin.left[0]),
|
|
e.appSidebarTransparent && (a = document.querySelector("." + app.sidebar.class)) && a.classList.add(app.sidebar.transparent.class),
|
|
e.appSidebarSearch && (a = document.querySelector("." + app.sidebar.class + " ." + app.sidebar.search.class)) && a.classList.remove(app.sidebar.search.hideClass),
|
|
e.appSidebarHover && t.classList.add(app.sidebar.hover.class),
|
|
e.appTopMenu && (t.classList.add(app.layout.topMenu.class), (a = document.querySelector("." + app.header.class + " [" + app.topMenu.mobile.toggleAttr + "]"))) && a.classList.remove(app.helper.display.none),
|
|
e.appWithoutHeader && (t.classList.add(app.layout.withoutHeader.class), (a = document.querySelector("." + app.header.class))) && (a.style.display = "none"),
|
|
e.appWithoutSidebar &&
|
|
(t.classList.add(app.layout.withoutSidebar.class),
|
|
(a = document.querySelector("." + app.header.class + " [" + app.sidebar.mobile.toggleAttr + "]")) && a.classList.add(app.helper.display.none),
|
|
(a = document.querySelector("." + app.sidebar.class)) && (a.style.display = "none"),
|
|
(a = document.querySelector("." + app.sidebar.bg.class)) && (a.style.display = "none"),
|
|
(a = document.querySelector("." + app.sidebar.mobile.backdrop.class))) &&
|
|
(a.style.display = "none"),
|
|
e.appHeaderInverse && (a = document.querySelector("." + app.header.class)) && a.setAttribute(app.darkMode.attr, app.darkMode.value),
|
|
e.pageContentFullWidth && (a = document.querySelector("." + app.content.class)) && a.classList.add(app.content.fullWidth.class),
|
|
e.appClass)
|
|
)
|
|
for (var l = e.appClass.split(" "), o = 0; o < l.length; o++) t.classList.add(l[o]);
|
|
if (e.appContentClass) if ((a = document.querySelector("." + app.content.class))) for (l = e.appContentClass.split(" "), o = 0; o < l.length; o++) a.classList.add(l[o]);
|
|
if (e.bodyClass) for (l = e.bodyClass.split(" "), o = 0; o < l.length; o++) document.body.classList.add(l[o]);
|
|
e.appBoxedLayout && document.body.classList.add(app.layout.boxedLayout.class), e.clearOptionOnLeave && (app.ajax.clearOption = e);
|
|
}
|
|
},
|
|
handleClearPageOption = function (e) {
|
|
var a,
|
|
t = document.querySelector("." + app.class);
|
|
if (t) {
|
|
if ((e.appContentFullHeight && t.classList.remove(app.content.fullHeight.class), e.appSidebarLight)) {
|
|
var s = document.querySelector("." + app.class + " ." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ")");
|
|
if (!s) return;
|
|
s.setAttribute(app.darkMode.attr, app.darkMode.value);
|
|
}
|
|
if (
|
|
(e.appSidebarEnd && t.classList.remove(app.layout.sidebarEnd.class),
|
|
e.appSidebarWide && t.classList.remove(app.layout.sidebarWide.class),
|
|
e.appSidebarMinified && t.classList.remove(app.layout.sidebarMinified.class),
|
|
e.appSidebarTwo &&
|
|
(t.classList.remove(app.layout.sidebarTwo.class),
|
|
t.classList.remove(app.sidebarEnd.toggledClass),
|
|
(a = document.querySelector("." + app.header.class + " [" + app.sidebarEnd.mobile.toggleAttr + "]")) && a.classList.add(app.helper.display.none),
|
|
(a = document.querySelector("." + app.header.class + " ." + app.header.brand.class))) &&
|
|
a.classList.add(app.helper.margin.left[0]),
|
|
e.appSidebarTransparent && (a = document.querySelector("." + app.sidebar.class)) && a.classList.remove(app.sidebar.transparent.class),
|
|
e.appSidebarSearch && (a = document.querySelector("." + app.sidebar.class + " ." + app.sidebar.search.class)) && a.classList.add(app.sidebar.search.hideClass),
|
|
e.appSidebarHover && t.classList.remove(app.sidebar.hover.class),
|
|
e.appTopMenu && (t.classList.remove(app.layout.topMenu.class), (a = document.querySelector("." + app.header.class + " [" + app.topMenu.mobile.toggleAttr + "]"))) && a.classList.add(app.helper.display.none),
|
|
e.appHeaderInverse && (a = document.querySelector("." + app.header.class)) && a.removeAttribute(app.darkMode.attr),
|
|
e.appWithoutSidebar &&
|
|
(t.classList.remove(app.layout.withoutSidebar.class),
|
|
(a = document.querySelector("." + app.header.class + " [" + app.sidebar.mobile.toggleAttr + "]")) && a.classList.remove(app.helper.display.none),
|
|
(a = document.querySelector("." + app.sidebar.class)) && a.removeAttribute("style"),
|
|
(a = document.querySelector("." + app.sidebar.bg.class)) && a.removeAttribute("style"),
|
|
(a = document.querySelector("." + app.sidebar.mobile.backdrop.class))) &&
|
|
a.removeAttribute("style"),
|
|
e.appWithoutHeader && (t.classList.remove(app.layout.withoutHeader.class), (a = document.querySelector("." + app.header.class))) && a.removeAttribute("style"),
|
|
e.appContentFullWidth && (a = document.querySelector("." + app.content.class)) && a.classList.remove(app.content.fullWidth.class),
|
|
e.appContentClass)
|
|
)
|
|
if ((a = document.querySelector("." + app.content.class))) for (var l = e.appContentClass.split(" "), o = 0; o < l.length; o++) a.classList.remove(l[o]);
|
|
if (e.appClass) for (l = e.appClass.split(" "), o = 0; o < l.length; o++) t.classList.remove(l[o]);
|
|
if (e.bodyClass) for (l = e.bodyClass.split(" "), o = 0; o < l.length; o++) document.body.classList.remove(l[o]);
|
|
e.appBoxedLayout && document.body.classList.remove(app.layout.boxedLayout.class);
|
|
}
|
|
},
|
|
handleToggleNavbarSearch = function () {
|
|
var e = document.querySelector("[" + app.header.floatingForm.toggleAttr + "]");
|
|
e &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector("." + app.header.class).classList.add(app.header.floatingForm.toggledClass);
|
|
}),
|
|
(e = document.querySelector("[" + app.header.floatingForm.dismissAttr + "]")) &&
|
|
(e.onclick = function (e) {
|
|
e.preventDefault(), document.querySelector("." + app.header.class).classList.remove(app.header.floatingForm.toggledClass);
|
|
});
|
|
},
|
|
convertNumberWithCommas = function (e) {
|
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
},
|
|
checkIsFloat = function (e) {
|
|
return Number(e) === e && e % 1 != 0;
|
|
},
|
|
checkIsInt = function (e) {
|
|
return Number(e) === e && e % 1 == 0;
|
|
},
|
|
countDecimals = function (e) {
|
|
e = e.toString().split(".");
|
|
return e[1] ? e[1].length : 0;
|
|
},
|
|
handleAnimation = function () {
|
|
var e = [].slice.call(document.querySelectorAll("[" + app.animation.attr + "]"));
|
|
e &&
|
|
e.map(function (e) {
|
|
var a = e.getAttribute(app.animation.attr),
|
|
l = e.getAttribute(app.animation.valueAttr);
|
|
switch (a) {
|
|
case "width":
|
|
e.style.width = l;
|
|
break;
|
|
case "height":
|
|
e.style.height = l;
|
|
break;
|
|
case "number":
|
|
for (var o = e, r = countDecimals(l), t = r; 0 < t; ) t--;
|
|
let s = () => {
|
|
var e = +l.replace(",", ""),
|
|
a = +(o.count || 0),
|
|
t = e / app.animation.speed;
|
|
a < e ? ((o.innerText = convertNumberWithCommas((a = a + t).toFixed(r))), (o.count = a), setTimeout(s, 1)) : (o.innerText = convertNumberWithCommas(e));
|
|
};
|
|
s();
|
|
break;
|
|
case "class":
|
|
e.classList.add(l);
|
|
}
|
|
});
|
|
},
|
|
handleSidebarSearch = function () {
|
|
var e = [].slice.call(document.querySelectorAll("[" + app.sidebar.search.toggleAttr + "]"));
|
|
e &&
|
|
e.map(function (e) {
|
|
e.onkeyup = function () {
|
|
var e,
|
|
t = this.value;
|
|
(t = t.toLowerCase())
|
|
? ((e = [].slice.call(
|
|
document.querySelectorAll(
|
|
"." +
|
|
app.sidebar.class +
|
|
":not(." +
|
|
app.sidebarEnd.class +
|
|
") ." +
|
|
app.sidebar.menu.class +
|
|
" > ." +
|
|
app.sidebar.menu.itemClass +
|
|
":not(." +
|
|
app.sidebar.profile.class +
|
|
"):not(." +
|
|
app.sidebar.menu.headerClass +
|
|
"):not(." +
|
|
app.sidebar.search.class +
|
|
"), ." +
|
|
app.sidebar.class +
|
|
":not(." +
|
|
app.sidebarEnd.class +
|
|
") ." +
|
|
app.sidebar.menu.submenu.class +
|
|
" > ." +
|
|
app.sidebar.menu.itemClass
|
|
)
|
|
)) &&
|
|
e.map(function (e) {
|
|
e.classList.add(app.sidebar.search.hideClass);
|
|
}),
|
|
(e = [].slice.call(document.querySelectorAll("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ") ." + app.sidebar.search.foundClass))) &&
|
|
e.map(function (e) {
|
|
e.classList.remove(app.sidebar.search.foundClass);
|
|
}),
|
|
(e = [].slice.call(document.querySelectorAll("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ") ." + app.sidebar.menu.expandClass))) &&
|
|
e.map(function (e) {
|
|
e.classList.remove(app.sidebar.menu.expandClass);
|
|
}),
|
|
(e = [].slice.call(
|
|
document.querySelectorAll(
|
|
"." +
|
|
app.sidebar.class +
|
|
":not(." +
|
|
app.sidebarEnd.class +
|
|
") ." +
|
|
app.sidebar.menu.class +
|
|
" > ." +
|
|
app.sidebar.menu.itemClass +
|
|
":not(." +
|
|
app.sidebar.profile.class +
|
|
"):not(." +
|
|
app.sidebar.menu.headerClass +
|
|
"):not(." +
|
|
app.sidebar.search.class +
|
|
") > ." +
|
|
app.sidebar.menu.itemLinkClass +
|
|
", ." +
|
|
app.sidebar.class +
|
|
" ." +
|
|
app.sidebar.menu.submenu.class +
|
|
" > ." +
|
|
app.sidebar.menu.itemClass +
|
|
" > ." +
|
|
app.sidebar.menu.itemLinkClass
|
|
)
|
|
)) &&
|
|
e.map(function (e) {
|
|
var a;
|
|
-1 < e.textContent.toLowerCase().search(t) &&
|
|
((a = e.closest("." + app.sidebar.menu.itemClass)) && (a.classList.remove(app.sidebar.search.hideClass), a.classList.add(app.sidebar.search.foundClass)),
|
|
(a =
|
|
(a = e.closest("." + app.sidebar.menu.itemClass + "." + app.sidebar.menu.hasSubClass)) &&
|
|
a.querySelector("." + app.sidebar.menu.submenu.class + " ." + app.sidebar.menu.itemClass + "." + app.sidebar.search.hideClass)) && a.classList.remove(app.sidebar.search.hideClass),
|
|
(a = e.closest("." + app.sidebar.menu.submenu.class))) &&
|
|
((a.style.display = "block"),
|
|
(a = a.querySelector("." + app.sidebar.menu.itemClass + ":not(." + app.sidebar.search.foundClass + ")")) && a.classList.add(app.sidebar.search.hideClass),
|
|
(a = e.closest("." + app.sidebar.menu.hasSubClass + ":not(." + app.sidebar.search.foundClass + ")"))) &&
|
|
(a.classList.remove(app.sidebar.search.hideClass), a.classList.add(app.sidebar.menu.expandClass), (a = a.closest("." + app.sidebar.menu.hasSubClass + ":not(." + app.sidebar.search.foundClass + ")"))) &&
|
|
(a.classList.remove(app.sidebar.search.hideClass), a.classList.add(app.sidebar.menu.expandClass));
|
|
}))
|
|
: ((e = [].slice.call(
|
|
document.querySelectorAll(
|
|
"." +
|
|
app.sidebar.class +
|
|
":not(." +
|
|
app.sidebarEnd.class +
|
|
") ." +
|
|
app.sidebar.menu.class +
|
|
" > ." +
|
|
app.sidebar.menu.itemClass +
|
|
":not(." +
|
|
app.sidebar.profile.class +
|
|
"):not(." +
|
|
app.sidebar.menu.headerClass +
|
|
"):not(." +
|
|
app.sidebar.search.class +
|
|
")." +
|
|
app.sidebar.menu.hasSubClass +
|
|
" ." +
|
|
app.sidebar.menu.submenu.class
|
|
)
|
|
)) &&
|
|
e.map(function (e) {
|
|
e.removeAttribute("style");
|
|
}),
|
|
(e = [].slice.call(
|
|
document.querySelectorAll(
|
|
"." +
|
|
app.sidebar.class +
|
|
":not(." +
|
|
app.sidebarEnd.class +
|
|
") ." +
|
|
app.sidebar.menu.class +
|
|
" > ." +
|
|
app.sidebar.menu.itemClass +
|
|
":not(." +
|
|
app.sidebar.profile.class +
|
|
"):not(." +
|
|
app.sidebar.menu.headerClass +
|
|
"):not(." +
|
|
app.sidebar.search.class +
|
|
")"
|
|
)
|
|
)) &&
|
|
e.map(function (e) {
|
|
e.classList.remove(app.sidebar.search.hideClass);
|
|
}),
|
|
(e = [].slice.call(document.querySelectorAll("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ") ." + app.sidebar.menu.submenu.class + " > ." + app.sidebar.menu.itemClass))) &&
|
|
e.map(function (e) {
|
|
e.classList.remove(app.sidebar.search.hideClass);
|
|
}),
|
|
(e = [].slice.call(document.querySelectorAll("." + app.sidebar.class + ":not(." + app.sidebarEnd.class + ") ." + app.sidebar.menu.expandClass))) &&
|
|
e.map(function (e) {
|
|
e.classList.remove(app.sidebar.menu.expandClass);
|
|
}));
|
|
};
|
|
});
|
|
},
|
|
handleToggleClass = function () {
|
|
var e = [].slice.call(document.querySelectorAll("[" + app.toggleClass.toggleAttr + "]"));
|
|
e &&
|
|
e.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = this.getAttribute(app.toggleClass.targetAttr) ? this.getAttribute(app.toggleClass.targetAttr) : "",
|
|
a = this.getAttribute(app.toggleClass.toggleAttr),
|
|
e = document.querySelector(e);
|
|
e && e.classList.toggle(a);
|
|
};
|
|
});
|
|
},
|
|
handleDismissClass = function () {
|
|
var e = [].slice.call(document.querySelectorAll("[" + app.dismissClass.toggleAttr + "]"));
|
|
e &&
|
|
e.map(function (e) {
|
|
e.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = this.getAttribute(app.dismissClass.targetAttr) ? this.getAttribute(app.dismissClass.targetAttr) : "",
|
|
a = this.getAttribute(app.dismissClass.toggleAttr),
|
|
e = document.querySelector(e);
|
|
e && e.classList.remove(a);
|
|
};
|
|
});
|
|
},
|
|
stringToColor = function (e) {
|
|
for (var a = 0, t = 0; t < e.length; t++) a = e.charCodeAt(t) + ((a << 5) - a);
|
|
for (var s = "#", t = 0; t < 3; t++) s += ("00" + ((a >> (8 * t)) & 255).toString(16)).substr(-2);
|
|
return s;
|
|
},
|
|
hexToRgba = function (e, a = 1, t = !1) {
|
|
var s;
|
|
if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(e))
|
|
return "rgba(" + [((s = "0x" + (s = 3 == (s = e.substring(1).split("")).length ? [s[0], s[0], s[1], s[1], s[2], s[2]] : s).join("")) >> 16) & 255, (s >> 8) & 255, 255 & s].join(",") + "," + a + ")";
|
|
if (t) throw new Error("Bad Hex");
|
|
return (e = stringToColor(e)), hexToRgba(e, a, !0);
|
|
},
|
|
handleCssVariable = function () {
|
|
var e = getComputedStyle(document.body);
|
|
if (app.variableFontList && app.variablePrefix)
|
|
for (var a = 0; a < app.variableFontList.length; a++) app.font[app.variableFontList[a].replace(/-([a-z|0-9])/g, (e, a) => a.toUpperCase())] = e.getPropertyValue("--" + app.variablePrefix + app.variableFontList[a]).trim();
|
|
if (app.variableColorList && app.variablePrefix)
|
|
for (a = 0; a < app.variableColorList.length; a++) app.color[app.variableColorList[a].replace(/-([a-z|0-9])/g, (e, a) => a.toUpperCase())] = e.getPropertyValue("--" + app.variablePrefix + app.variableColorList[a]).trim();
|
|
},
|
|
handleScrollTo = function () {
|
|
[].slice.call(document.querySelectorAll("[" + app.scrollTo.toggleAttr + "]")).map(function (s) {
|
|
s.onclick = function (e) {
|
|
e.preventDefault();
|
|
var e = s.getAttribute(app.scrollTo.targetAttr) ? this.getAttribute(app.scrollTo.targetAttr) : this.getAttribute("href"),
|
|
e = document.querySelectorAll(e)[0],
|
|
a = document.querySelectorAll("." + app.header.class)[0].offsetHeight,
|
|
t = document.querySelector("." + app.content.class),
|
|
t = window.getComputedStyle(t),
|
|
t = t ? parseInt(t.getPropertyValue("padding-top")) : 0;
|
|
e && ((e = e.offsetTop - a - t), window.scrollTo({ top: e, behavior: "smooth" }));
|
|
};
|
|
});
|
|
},
|
|
App = (() => {
|
|
var a;
|
|
return {
|
|
init: function (e) {
|
|
e && (a = e),
|
|
this.initLocalStorage(),
|
|
this.initTopMenu(),
|
|
this.initComponent(),
|
|
this.initPageLoad(),
|
|
this.initSidebar(),
|
|
this.initThemePanel(),
|
|
this.initVariable(),
|
|
window.dispatchEvent(new CustomEvent("load")),
|
|
a && a.ajaxMode && this.initAjax();
|
|
},
|
|
settings: function (e) {
|
|
e && (a = e);
|
|
},
|
|
initSidebar: function () {
|
|
handleSidebarMenu(),
|
|
handleSidebarToggle(),
|
|
handleSidebarEndToggle(),
|
|
handleSidebarMinify(),
|
|
handleSidebarMinifyFloatMenu(),
|
|
handleToggleNavProfile(),
|
|
handleToggleNavbarSearch(),
|
|
handleSidebarSearch(),
|
|
(a && a.disableSidebarScrollMemory) || handleSidebarScrollMemory();
|
|
},
|
|
initTopMenu: function () {
|
|
handleUnlimitedTopMenuRender(), handleTopMenuSubMenu(), handleTopMenuMobileToggle();
|
|
},
|
|
initPageLoad: function () {
|
|
handlePageLoader();
|
|
},
|
|
initComponent: function () {
|
|
(a && a.disableDraggablePanel) || handlePanelDraggable(),
|
|
handleScrollbar(),
|
|
handleScrollTo(),
|
|
handleUnlimitedTabsRender(),
|
|
handlePanelAction(),
|
|
handleScrollToTopButton(),
|
|
handlePageScrollClass(),
|
|
handleAnimation(),
|
|
handleToggleClass(),
|
|
handleDismissClass(),
|
|
handleAjaxMode.initToggler(),
|
|
767 < document.body.clientWidth && handelTooltipPopoverActivation();
|
|
},
|
|
initLocalStorage: function () {
|
|
(a && a.disableLocalStorage) || handleLocalStorage();
|
|
},
|
|
initThemePanel: function () {
|
|
handleThemePanel(), handleResetLocalStorage();
|
|
},
|
|
initAjax: function () {
|
|
handleAjaxMode.init(a);
|
|
},
|
|
initVariable: function () {
|
|
handleCssVariable();
|
|
},
|
|
setPageTitle: function (e) {
|
|
document.title = e;
|
|
},
|
|
setPageOption: function (e) {
|
|
handleSetPageOption(e);
|
|
},
|
|
clearPageOption: function (e) {
|
|
handleClearPageOption(e);
|
|
},
|
|
restartGlobalFunction: function () {
|
|
for (var e = [".jvectormap-tip", ".daterangepicker"], a = 0; a < e.length; a++) {
|
|
var t = [].slice.call(document.querySelectorAll(e[a]));
|
|
t &&
|
|
t.map(function (e) {
|
|
e.remove();
|
|
});
|
|
}
|
|
this.initLocalStorage(), this.initComponent();
|
|
},
|
|
scrollTop: function () {
|
|
document.body.scrollTop = 0;
|
|
},
|
|
};
|
|
})();
|
|
"loading" !== document.readyState
|
|
? (App.init(), App.restartGlobalFunction())
|
|
: document.addEventListener("DOMContentLoaded", function () {
|
|
App.init(), App.restartGlobalFunction();
|
|
});
|