/* Template Name: Color Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.2 Version: 1.6.0 Author: Sean Ngu Website: http://www.seantheme.com/color-admin-v1.6/admin/ */ var handleSlimScroll = function () { "use strict"; $("[data-scrollbar=true]").each(function () { generateSlimScroll($(this)) }) }; var generateSlimScroll = function (e) { var t = $(e).attr("data-height"); t = !t ? $(e).height() : t; var n = {height: t, alwaysVisible: true}; if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { n.wheelStep = 5; n.touchScrollStep = 500 } $(e).slimScroll(n) }; var handleSidebarMenu = function () { "use strict"; $(".sidebar .nav > .has-sub > a").click(function () { var e = $(this).next(".sub-menu"); var t = ".sidebar .nav > li.has-sub > .sub-menu"; if ($(".page-sidebar-minified").length === 0) { $(t).not(e).slideUp(250, function () { $(this).closest("li").removeClass("expand") }); $(e).slideToggle(250, function () { var e = $(this).closest("li"); if ($(e).hasClass("expand")) { $(e).removeClass("expand") } else { $(e).addClass("expand") } }) } }); $(".sidebar .nav > .has-sub > .sub-menu > li > a").click(function () { if ($(".page-sidebar-minified").length === 0) { var e = $(this).next(".sub-menu"); //$(e).slideToggle(250) var t = ".sidebar .nav > .has-sub > .sub-menu > li > .sub-menu"; if ($(".page-sidebar-minified").length === 0) { $(t).not(e).slideUp(250, function () { $(this).closest("li").removeClass("expand") }); $(e).slideToggle(250, function () { var e = $(this).closest("li"); if ($(e).hasClass("expand")) { $(e).removeClass("expand") } else { $(e).addClass("expand") } }) } } }) }; var handleMobileSidebarToggle = function () { var e = false; $(".sidebar").on("click touchstart", function (t) { if ($(t.target).closest(".sidebar").length !== 0) { e = true } else { e = false; t.stopPropagation() } }); $(document).on("click touchstart", function (t) { if ($(t.target).closest(".sidebar").length === 0) { e = false } if (!t.isPropagationStopped() && e !== true) { if ($("#page-container").hasClass("page-sidebar-toggled")) { e = true; $("#page-container").removeClass("page-sidebar-toggled") } if ($(window).width() < 979) { if ($("#page-container").hasClass("page-with-two-sidebar")) { e = true; $("#page-container").removeClass("page-right-sidebar-toggled") } } } }); $("[data-click=right-sidebar-toggled]").click(function (t) { t.stopPropagation(); var n = "#page-container"; var r = "page-right-sidebar-collapsed"; r = $(window).width() < 979 ? "page-right-sidebar-toggled" : r; if ($(n).hasClass(r)) { $(n).removeClass(r) } else if (e !== true) { $(n).addClass(r) } else { e = false } if ($(window).width() < 480) { $("#page-container").removeClass("page-sidebar-toggled") } }); $("[data-click=sidebar-toggled]").click(function (t) { t.stopPropagation(); var n = "page-sidebar-toggled"; var r = "#page-container"; if ($(r).hasClass(n)) { $(r).removeClass(n) } else if (e !== true) { $(r).addClass(n) } else { e = false } if ($(window).width() < 480) { $("#page-container").removeClass("page-right-sidebar-toggled") } }) }; var handleSidebarMinify = function () { $("[data-click=sidebar-minify]").click(function (e) { e.preventDefault(); var t = "page-sidebar-minified"; var n = "#page-container"; if ($(n).hasClass(t)) { $(n).removeClass(t); if ($(n).hasClass("page-sidebar-fixed")) { generateSlimScroll($('#sidebar [data-scrollbar="true"]')) } sessionStorage.setItem('page_sidebar_minified',"false"); } else { $(n).addClass(t); if ($(n).hasClass("page-sidebar-fixed")) { $('#sidebar [data-scrollbar="true"]').slimScroll({destroy: true}); $('#sidebar [data-scrollbar="true"]').removeAttr("style") } $("#sidebar [data-scrollbar=true]").trigger("mouseover") sessionStorage.setItem('page_sidebar_minified',"true"); } $(window).trigger("resize") }) }; var handlePageContentView = function () { "use strict"; $.when($("#page-loader").addClass("hide")).done(function () { $("#page-container").addClass("in") }) }; var handlePanelAction = function () { "use strict"; $("[data-click=panel-remove]").hover(function () { $(this).tooltip({title: "关闭", placement: "bottom", trigger: "hover", container: "body"}); $(this).tooltip("show") }); $("[data-click=panel-remove]").click(function (e) { e.preventDefault(); $(this).tooltip("destroy"); $(this).closest(".panel").remove() $('#header').show(); }); $("[data-click=panel-collapse]").hover(function () { $(this).tooltip({title: "折叠/展开", placement: "bottom", trigger: "hover", container: "body"}); $(this).tooltip("show") }); $("[data-click=panel-collapse]").click(function (e) { e.preventDefault(); $(this).closest(".panel").find(".panel-body").slideToggle() }); $("[data-click=panel-reload]").hover(function () { $(this).tooltip({title: "刷新", placement: "bottom", trigger: "hover", container: "body"}); $(this).tooltip("show") }); $("[data-click=panel-reload]").click(function (e) { e.preventDefault(); var t = $(this).closest(".panel"); if (!$(t).hasClass("panel-loading")) { var n = $(t).find(".panel-body"); var r = '