/*! * stack-admin-theme (https://pixinvent.com/bootstrap-admin-template/stack) * Copyright 2018 PIXINVENT * Licensed under the Themeforest Standard Licenses */ !function(window,document,$){"use strict";var $html=$("html"),$body=$("body");$(window).on("load",function(){function setContentMenuHeight(){var menuHeight=$(".main-menu").height(),bodyHeight=$(".content-body").height();bodyHeight0&&($(".navbar-hide-on-scroll.fixed-top").headroom({offset:205,tolerance:5,classes:{initial:"headroom",pinned:"headroom--pinned-top",unpinned:"headroom--unpinned-top"}}),$(".navbar-hide-on-scroll.fixed-bottom").headroom({offset:205,tolerance:5,classes:{initial:"headroom",pinned:"headroom--pinned-bottom",unpinned:"headroom--unpinned-bottom"}})),setTimeout(function(){$("body").hasClass("vertical-content-menu")&&setContentMenuHeight()},500),$('a[data-action="collapse"]').on("click",function(e){e.preventDefault(),$(this).closest(".card").children(".card-content").collapse("toggle"),$(this).closest(".card").find('[data-action="collapse"] i').toggleClass("ft-minus ft-plus")}),$('a[data-action="expand"]').on("click",function(e){e.preventDefault(),$(this).closest(".card").find('[data-action="expand"] i').toggleClass("ft-maximize ft-minimize"),$(this).closest(".card").toggleClass("card-fullscreen")}),$(".scrollable-container").length>0&&$(".scrollable-container").perfectScrollbar({theme:"dark"}),$('a[data-action="reload"]').on("click",function(){var block_ele=$(this).closest(".card");block_ele.block({message:'
',timeout:2e3,overlayCSS:{backgroundColor:"#FFF",cursor:"wait"},css:{border:0,padding:0,backgroundColor:"none"}})}),$('a[data-action="close"]').on("click",function(){$(this).closest(".card").removeClass().slideUp("fast")}),setTimeout(function(){$(".row.match-height").each(function(){$(this).find(".card").not(".card .card").matchHeight()})},500),$('.card .heading-elements a[data-action="collapse"]').on("click",function(){var cardHeight,$this=$(this),card=$this.closest(".card");parseInt(card[0].style.height,10)>0?(cardHeight=card.css("height"),card.css("height","").attr("data-height",cardHeight)):card.data("height")&&(cardHeight=card.data("height"),card.css("height",cardHeight).attr("data-height",""))});var menuType=$body.data("menu");"vertical-compact-menu"!=menuType&&"horizontal-menu"!=menuType&&compactMenu===!1&&("vertical-menu-modern"==$body.data("menu")?"true"===localStorage.getItem("menuLocked")&&$(".main-menu-content").find("li.active").parents("li").addClass("open"):$(".main-menu-content").find("li.active").parents("li").addClass("open")),"vertical-compact-menu"!=menuType&&"horizontal-menu"!=menuType||($(".main-menu-content").find("li.active").parents("li:not(.nav-item)").addClass("open"),$(".main-menu-content").find("li.active").parents("li").addClass("active")),$(".heading-elements-toggle").on("click",function(){$(this).parent().children(".heading-elements").toggleClass("visible")});var chartjsDiv=$(".chartjs"),canvasHeight=chartjsDiv.children("canvas").attr("height");if(chartjsDiv.css("height",canvasHeight),$body.hasClass("boxed-layout")&&($body.hasClass("vertical-overlay-menu")||$body.hasClass("vertical-compact-menu"))){var menuWidth=$(".main-menu").width(),contentPosition=$(".app-content").position().left,menuPositionAdjust=contentPosition-menuWidth;$body.hasClass("menu-flipped")?$(".main-menu").css("right",menuPositionAdjust+"px"):$(".main-menu").css("left",menuPositionAdjust+"px")}$(".nav-link-search").on("click",function(){var searchInput=($(this),$(this).siblings(".search-input"));searchInput.hasClass("open")?searchInput.removeClass("open"):searchInput.addClass("open")})}),$(document).on("click",".menu-toggle, .modern-nav-toggle",function(e){return e.preventDefault(),$.app.menu.toggle(),setTimeout(function(){$(window).trigger("resize")},200),$("#collapsed-sidebar").length>0&&setTimeout(function(){$body.hasClass("menu-expanded")||$body.hasClass("menu-open")?$("#collapsed-sidebar").prop("checked",!1):$("#collapsed-sidebar").prop("checked",!0)},1e3),!1}),$(document).on("click",".open-navbar-container",function(e){var currentBreakpoint=Unison.fetch.now();$.app.menu.drillDownMenu(currentBreakpoint.name)}),$(document).on("click",".main-menu-footer .footer-toggle",function(e){return e.preventDefault(),$(this).find("i").toggleClass("pe-is-i-angle-down pe-is-i-angle-up"),$(".main-menu-footer").toggleClass("footer-close footer-open"),!1}),$(".navigation").find("li").has("ul").addClass("has-sub"),$(".carousel").carousel({interval:2e3}),$(".nav-link-expand").on("click",function(e){"undefined"!=typeof screenfull&&screenfull.enabled&&screenfull.toggle()}),"undefined"!=typeof screenfull&&screenfull.enabled&&$(document).on(screenfull.raw.fullscreenchange,function(){screenfull.isFullscreen?$(".nav-link-expand").find("i").toggleClass("ft-minimize ft-maximize"):$(".nav-link-expand").find("i").toggleClass("ft-maximize ft-minimize")}),$(document).on("click",".mega-dropdown-menu",function(e){e.stopPropagation()}),$(document).ready(function(){$(".step-icon").each(function(){var $this=$(this);$this.siblings("span.step").length>0&&($this.siblings("span.step").empty(),$(this).appendTo($(this).siblings("span.step")))})}),$(window).resize(function(){$.app.menu.manualScroller.updateHeight()}),$(".nav.nav-tabs a.dropdown-item").on("click",function(){var $this=$(this),href=$this.attr("href"),tabs=$this.closest(".nav");tabs.find(".nav-link").removeClass("active"),$this.closest(".nav-item").find(".nav-link").addClass("active"),$this.closest(".dropdown-menu").find(".dropdown-item").removeClass("active"),$this.addClass("active"),tabs.next().find(href).siblings(".tab-pane").removeClass("active in").attr("aria-expanded",!1),$(href).addClass("active in").attr("aria-expanded","true")}),$("#sidebar-page-navigation").on("click","a.nav-link",function(e){e.preventDefault(),e.stopPropagation();var $this=$(this),href=$this.attr("href"),offset=$(href).offset(),scrollto=offset.top-80;$("html, body").animate({scrollTop:scrollto},0),setTimeout(function(){$this.parent(".nav-item").siblings(".nav-item").children(".nav-link").removeClass("active"),$this.addClass("active")},100)})}(window,document,jQuery);