You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
11 KiB
6 lines
11 KiB
/*!
|
|
* stack-admin-theme (https://pixinvent.com/bootstrap-admin-template/stack)
|
|
* Copyright 2018 PIXINVENT
|
|
* Licensed under the Themeforest Standard Licenses
|
|
*/
|
|
!function(window,document,$){"use strict";function chkBgClass(elm){if(elm.attr("class").match(/\bbg-\S+/g)){bgClass=elm.attr("class").match(/\bbg-\S+/g);var classes="";$.map(bgClass,function(k,v){classes=0===v?k:classes+" "+k}),bgClass=classes}else bgClass="";return bgClass}function resetBgClass(elm){elm.removeClass("navbar-semi-dark navbar-semi-light navbar-light navbar-dark navbar-shadow "+bgClass);var bgClassHeader="";$(".navbar-header").attr("class").match(/\bbg-\S+/g)&&(bgClassHeader=$(".navbar-header").attr("class").match(/\bbg-\S+/g)[0]),$(".navbar-header").removeClass(bgClassHeader)}function addBgClass(elm,classes){elm.addClass(classes)}function changeLogo(logo){"light"==logo?$(".brand-logo").attr("src","../../../app-assets/images/logo/logo.png"):$(".brand-logo").attr("src","../../../app-assets/images/logo/logo.png")}$(".customizer-toggle").on("click",function(){$(".customizer").toggleClass("open")}),$(".customizer-close").on("click",function(){$(".customizer").removeClass("open")}),$(".customizer-content").length>0&&$(".customizer-content").perfectScrollbar({theme:"dark"});var body=$("body"),header_navbar=$("nav.header-navbar"),horz_header_navbar=$("div.header-navbar"),footer=$("footer"),menu=$(".main-menu"),menu_type=body.data("menu"),horz_layout=!1,semiLight=!1,semiDark=!1;header_navbar.hasClass("navbar-semi-light")&&(semiLight=!0),header_navbar.hasClass("navbar-semi-dark")&&(semiDark=!0),"horizontal-menu"==menu_type&&(horz_layout=!0,$(".layout-options .navbar").parent(".nav-item").attr("style","display: none !important"),$(".color-options .nav-semi-light").parent(".nav-item").attr("style","display: none !important"),$(".color-options .nav-semi-dark").parent(".nav-item").attr("style","display: none !important"),$("#native-scroll").parent(".custom-checkbox").attr("style","display: none !important"),$("#bordered-navigation").parent(".custom-checkbox").attr("style","display: none !important"),$("#collapsible-navigation").parent(".custom-checkbox").attr("style","display: none !important"),$("#static-navigation").parent(".custom-checkbox").attr("style","display: none !important"),$("#flipped-navigation").parent(".custom-checkbox").attr("style","display: none !important"),$(".color-options li:eq(3) a").tab("show")),"vertical-compact-menu"!==menu_type&&"vertical-content-menu"!==menu_type&&"vertical-overlay-menu"!==menu_type||($(".color-options a#color-opt-3").tab("show"),"vertical-content-menu"===menu_type&&$(".color-options a#color-opt-4").tab("show"),"vertical-compact-menu"!==menu_type&&"vertical-overlay-menu"!==menu_type||$("#boxed-layout").parent(".custom-checkbox").attr("style","display: none !important"),$(".color-options .nav-semi-light").parent(".nav-item").attr("style","display: none !important"),$(".color-options .nav-semi-dark").parent(".nav-item").attr("style","display: none !important")),"vertical-overlay-menu"===menu_type&&($("#collapsed-sidebar").prop("checked",!0),$("#static-layout").parent(".custom-checkbox").attr("style","display: none !important"),$("#static-navigation").parent(".custom-checkbox").attr("style","display: none !important")),$("#collapsed-sidebar").on("click",function(){$.app.menu.toggle(),setTimeout(function(){$(window).trigger("resize")},100)}),$("#fixed-layout").on("click",function(){$("#boxed-layout").prop("checked")===!0&&$("#boxed-layout").trigger("click"),$(this).prop("checked")===!0?(body.hasClass("fixed-navbar")||horz_layout!==!1||body.addClass("fixed-navbar"),header_navbar.hasClass("fixed-top")||horz_layout!==!1||header_navbar.addClass("fixed-top"),footer.hasClass("navbar-fixed-bottom")||footer.addClass("navbar-fixed-bottom"),horz_header_navbar.hasClass("navbar-fixed")||horz_layout!==!0||horz_header_navbar.addClass("navbar-fixed"),header_navbar.removeClass("navbar-static-top"),horz_header_navbar.removeClass("navbar-static"),menu.removeClass("menu-static"),footer.removeClass("footer-static")):footer.removeClass("navbar-fixed-bottom")}),$("#boxed-layout").on("click",function(){$("#fixed-layout").prop("checked")===!0&&$("#fixed-layout").trigger("click"),$(this).prop("checked")===!0?(body.hasClass("container boxed-layout")||body.addClass("container boxed-layout"),header_navbar.hasClass("container boxed-layout")||header_navbar.addClass("container boxed-layout"),header_navbar.removeClass("navbar-static-top"),menu.removeClass("menu-static"),footer.removeClass("footer-static")):(body.removeClass("container boxed-layout"),header_navbar.removeClass("container boxed-layout"))}),$("#static-layout").on("click",function(){$(this).prop("checked")===!0?(header_navbar.hasClass("navbar-static-top")||header_navbar.addClass("navbar-static-top"),menu.hasClass("menu-static")||menu.addClass("menu-static"),footer.hasClass("footer-static")||footer.addClass("footer-static"),horz_layout===!0&&(horz_header_navbar.unstick(),horz_header_navbar.addClass("navbar-static")),body.removeClass("fixed-navbar"),header_navbar.removeClass("fixed-top"),horz_header_navbar.removeClass("menu-fixed"),menu.removeClass("menu-fixed"),footer.removeClass("navbar-fixed-bottom"),$.app.menu.manualScroller.disable()):(horz_layout===!1&&(body.addClass("fixed-navbar"),menu.removeClass("navbar-static").addClass("menu-fixed"),header_navbar.removeClass("navbar-static-top").addClass("fixed-top")),horz_layout===!0&&(horz_header_navbar.sticky(),horz_header_navbar.removeClass("navbar-static").addClass("navbar-fixed")),footer.removeClass("footer-static"),$.app.menu.manualScroller.enable())}),"vertical-overlay-menu"===menu_type&&$("#brand-center").prop("checked",!0),$("#brand-center").on("click",function(){header_navbar.hasClass("navbar-brand-center")?(1==semiLight&&(header_navbar.removeClass("navbar-dark navbar-brand-center"),changeLogo("dark"),header_navbar.addClass("navbar-semi-light")),1==semiDark&&(header_navbar.removeClass("navbar-dark navbar-brand-center"),changeLogo("light"),header_navbar.addClass("navbar-semi-dark"))):(1==semiLight&&header_navbar.removeClass("navbar-semi-light"),1==semiDark&&header_navbar.removeClass("navbar-semi-dark"),header_navbar.addClass("navbar-dark navbar-brand-center"),changeLogo("light"))}),$("#navbar-static-top").on("click",function(){$(this).prop("checked")===!0?(header_navbar.hasClass("navbar-static-top")||header_navbar.addClass("navbar-static-top"),menu.hasClass("menu-static")||menu.addClass("menu-static"),footer.hasClass("footer-static")||footer.addClass("footer-static"),body.removeClass("fixed-navbar"),header_navbar.removeClass("fixed-top"),menu.removeClass("menu-fixed"),footer.removeClass("navbar-fixed-bottom"),$.app.menu.manualScroller.disable()):(body.addClass("fixed-navbar"),header_navbar.removeClass("navbar-static-top").addClass("fixed-top"),menu.removeClass("menu-static").addClass("menu-fixed"),footer.removeClass("footer-static"),$.app.menu.manualScroller.enable())}),$("#native-scroll").on("click",function(){$("#static-navigation").prop("checked")===!0&&(menu.removeClass("menu-static").addClass("menu-fixed"),$("#static-navigation").attr("checked",!1)),menu.hasClass("menu-native-scroll")?(menu.removeClass("menu-native-scroll"),$.app.menu.manualScroller.enable()):(menu.addClass("menu-native-scroll"),$.app.menu.manualScroller.disable())}),$("#right-side-icons").on("click",function(){menu.hasClass("menu-icon-right")?menu.removeClass("menu-icon-right"):menu.addClass("menu-icon-right"),horz_layout===!0&&(horz_header_navbar.hasClass("navbar-icon-right")?horz_header_navbar.removeClass("navbar-icon-right"):horz_header_navbar.addClass("navbar-icon-right"))}),$("#bordered-navigation").on("click",function(){menu.hasClass("menu-bordered")?menu.removeClass("menu-bordered"):menu.addClass("menu-bordered")}),$("#flipped-navigation").on("click",function(){body.hasClass("menu-flipped")?body.removeClass("menu-flipped"):(body.addClass("menu-flipped"),$(".customizer-close").trigger("click")),horz_layout===!0&&(horz_header_navbar.hasClass("navbar-flipped")?horz_header_navbar.removeClass("navbar-flipped"):horz_header_navbar.addClass("navbar-flipped"))}),$("#collapsible-navigation").on("click",function(){menu.hasClass("menu-collapsible")?menu.removeClass("menu-collapsible"):menu.addClass("menu-collapsible")}),$("#static-navigation").on("click",function(){$("#native-scroll").prop("checked")===!0&&(menu.removeClass("menu-native-scroll"),$("#native-scroll").attr("checked",!1)),menu.hasClass("menu-static")?(menu.removeClass("menu-static").addClass("menu-fixed"),$.app.menu.manualScroller.enable()):(menu.addClass("menu-static").removeClass("menu-fixed"),$.app.menu.manualScroller.disable())}),$(".main-menu").hasClass("menu-dark")?$(".customizer-sidebar-options").find('[data-sidebar="menu-dark"]').addClass("active").siblings("btn").removeClass("active"):$(".customizer-sidebar-options").find('[data-sidebar="menu-light"]').addClass("active").siblings("btn").removeClass("active"),$(".customizer-sidebar-options .btn").on("click",function(){var $this=$(this),sidebarColor=$this.attr("data-sidebar");$this.addClass("active").siblings(".btn").removeClass("active"),$(".main-menu").removeClass("menu-dark menu-light").addClass(sidebarColor),horz_layout===!0&&(horz_header_navbar.removeClass("navbar-dark navbar-light"),"menu-light"==sidebarColor?horz_header_navbar.addClass("navbar-light"):horz_header_navbar.addClass("navbar-dark"))});var el=$("nav.header-navbar"),bgClass="";el.attr("class").match(/\bbg-\S+/g)&&(bgClass=el.attr("class").match(/\bbg-\S+/g)[0]),$(".nav-semi-light").on("click",function(){chkBgClass(el),changeLogo("dark"),resetBgClass(el),addBgClass(el,"navbar-semi-light bg-gradient-x-grey-blue"),$("input[name=nav-slight-clr].default").prop("checked",!0),semiLight=!0,semiDark=!1}),$("input[name='nav-slight-clr']").change(function(){1==semiDark&&el.removeClass("navbar-semi-dark").addClass("navbar-semi-light"),bgClass=chkBgClass(el),el.removeClass(bgClass).addClass($(this).data("bg"))}),$(".nav-semi-dark").on("click",function(){chkBgClass(el),changeLogo("light"),resetBgClass(el),addBgClass(el,"navbar-semi-dark navbar-shadow"),$("input[name=nav-sdark-clr].default").prop("checked",!0),semiLight=!1,semiDark=!0}),$("input[name='nav-sdark-clr']").change(function(){1==semiLight&&el.removeClass("navbar-semi-light").addClass("navbar-semi-dark");var el=$(".navbar-header"),bgClass=chkBgClass(el);el.removeClass(bgClass).addClass($(this).data("bg"))}),$(".nav-dark").on("click",function(){chkBgClass(el),changeLogo("light"),resetBgClass(el),addBgClass(el,"navbar-dark"),$("input[name=nav-dark-clr].default").prop("checked",!0)}),$("input[name='nav-dark-clr']").change(function(){var bgClass=chkBgClass(el);el.removeClass(bgClass).addClass($(this).data("bg"))}),$(".nav-light").on("click",function(){chkBgClass(el),changeLogo("dark"),resetBgClass(el),addBgClass(el,"navbar-light navbar-shadow"),$("input[name=nav-light-clr].default").prop("checked",!0)}),$("input[name='nav-light-clr']").change(function(){var bgClass=chkBgClass(el);el.removeClass(bgClass).addClass($(this).data("bg"))})}(window,document,jQuery); |