gentelella/build/js/custom.min.js

1 line
70 KiB
JavaScript
Raw Normal View History

2020-01-12 01:34:50 +00:00
!function(a){jQuery.fn[a]=function(e){return e?this.bind("resize",(t=e,function(){var e=this,a=arguments;i?clearTimeout(i):n&&t.apply(e,a),i=setTimeout(function(){n||t.apply(e,a),i=null},o||100)})):this.trigger(a);var t,o,n,i}}((jQuery,"smartresize"));var CURRENT_URL=window.location.href.split("#")[0].split("?")[0],$BODY=$("body"),$MENU_TOGGLE=$("#menu_toggle"),$SIDEBAR_MENU=$("#sidebar-menu"),$SIDEBAR_FOOTER=$(".sidebar-footer"),$LEFT_COL=$(".left_col"),$RIGHT_COL=$(".right_col"),$NAV_MENU=$(".nav_menu"),$FOOTER=$("footer");function init_sidebar(){function t(){$RIGHT_COL.css("min-height",$(window).height());var e=$BODY.outerHeight(),a=$BODY.hasClass("footer_fixed")?-10:$FOOTER.height(),t=$LEFT_COL.eq(1).height()+$SIDEBAR_FOOTER.height(),o=e<t?t:e;o-=$NAV_MENU.height()+a,$RIGHT_COL.css("min-height",o)}function o(){$SIDEBAR_MENU.find("li").removeClass("active active-sm"),$SIDEBAR_MENU.find("li ul").slideUp()}$SIDEBAR_MENU.find("a").on("click",function(e){var a=$(this).parent();a.is(".active")?(a.removeClass("active active-sm"),$("ul:first",a).slideUp(function(){t()})):(a.parent().is(".child_menu")?$BODY.is("nav-sm")&&(a.parent().is("child_menu")||o()):o(),a.addClass("active"),$("ul:first",a).slideDown(function(){t()}))}),$MENU_TOGGLE.on("click",function(){$BODY.hasClass("nav-md")?($SIDEBAR_MENU.find("li.active ul").hide(),$SIDEBAR_MENU.find("li.active").addClass("active-sm").removeClass("active")):($SIDEBAR_MENU.find("li.active-sm ul").show(),$SIDEBAR_MENU.find("li.active-sm").addClass("active").removeClass("active-sm")),$BODY.toggleClass("nav-md nav-sm"),t(),$(".dataTable").each(function(){$(this).dataTable().fnDraw()})}),$SIDEBAR_MENU.find('a[href="'+CURRENT_URL+'"]').parent("li").addClass("current-page"),$SIDEBAR_MENU.find("a").filter(function(){return this.href==CURRENT_URL}).parent("li").addClass("current-page").parents("ul").slideDown(function(){t()}).parent().addClass("active"),$(window).smartresize(function(){t()}),t(),$.fn.mCustomScrollbar&&$(".menu_fixed").mCustomScrollbar({autoHideScrollbar:!0,theme:"minimal",mouseWheel:{preventDefault:!0}})}$(document).ready(function(){$(".collapse-link").on("click",function(){var e=$(this).closest(".x_panel"),a=$(this).find("i"),t=e.find(".x_content");e.attr("style")?t.slideToggle(200,function(){e.removeAttr("style")}):(t.slideToggle(200),e.css("height","auto")),a.toggleClass("fa-chevron-up fa-chevron-down")}),$(".close-link").click(function(){$(this).closest(".x_panel").remove()})}),$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip({container:"body"})}),$(document).ready(function(){$(".progress .progress-bar")[0]&&$(".progress .progress-bar").progressbar()}),$(document).ready(function(){$(".js-switch")[0]&&Array.prototype.slice.call(document.querySelectorAll(".js-switch")).forEach(function(e){new Switchery(e,{color:"#26B99A"})})}),$(document).ready(function(){$("input.flat")[0]&&$(document).ready(function(){$("input.flat").iCheck({checkboxClass:"icheckbox_flat-green",radioClass:"iradio_flat-green"})})}),$("table input").on("ifChecked",function(){checkState="",$(this).parent().parent().parent().addClass("selected"),countChecked()}),$("table input").on("ifUnchecked",function(){checkState="",$(this).parent().parent().parent().removeClass("selected"),countChecked()});var checkState="";function countChecked(){"all"===checkState&&$(".bulk_action input[name='table_records']").iCheck("check"),"none"===checkState&&$(".bulk_action input[name='table_records']").iCheck("uncheck");var e=$(".bulk_action input[name='table_records']:checked").length;e?($(".column-title").hide(),$(".bulk-actions").show(),$(".action-cnt").html(e+" Records Selected")):($(".column-title").show(),$(".bulk-actions").hide())}$(".bulk_action input").on("ifChecked",function(){checkState="",$(this).parent().parent().parent().addClass("selected"),countChecked()}),$(".bulk_action input").on("ifUnchecked",function(){checkState="",$(this).parent().parent().parent().removeClass("selected"),countChecked()}),$(".bulk_action input#check-all").on("ifChecked",function(){checkState="all",countChecked()}),$(".bu