diff --git a/build/js/custom.js b/build/js/custom.js index 2ba1382c..466e495f 100644 --- a/build/js/custom.js +++ b/build/js/custom.js @@ -68,27 +68,37 @@ $(document).ready(function() { }; $SIDEBAR_MENU.find('a').on('click', function(ev) { - var $li = $(this).parent(); + var $li = $(this).parent(); + if ($li.is('.active')) { + $li.removeClass('active active-sm'); + $('ul:first', $li).slideUp(function() { + setContentHeight(); + }); + } + else + { + // prevent closing menu if we are on child menu + if (!$li.parent().is('.child_menu')) { + $SIDEBAR_MENU.find('li').removeClass('active active-sm'); + $SIDEBAR_MENU.find('li ul').slideUp(); + }else + { + if ( $BODY.is( ".nav-sm" ) ) + { + if (!$li.parent().is('.child_menu')) { + $SIDEBAR_MENU.find('li').removeClass('active active-sm'); + $SIDEBAR_MENU.find('li ul').slideUp(); + } + } + } + $li.addClass('active'); - if ($li.is('.active')) { - $li.removeClass('active active-sm'); - $('ul:first', $li).slideUp(function() { - setContentHeight(); - }); - } else { - // prevent closing menu if we are on child menu - if (!$li.parent().is('.child_menu')) { - $SIDEBAR_MENU.find('li').removeClass('active active-sm'); - $SIDEBAR_MENU.find('li ul').slideUp(); - } + $('ul:first', $li).slideDown(function() { + + }); + } + }); - $li.addClass('active'); - - $('ul:first', $li).slideDown(function() { - setContentHeight(); - }); - } - }); // toggle small or large menu $MENU_TOGGLE.on('click', function() { diff --git a/build/js/custom.min.js b/build/js/custom.min.js index 0bd18f1c..5706ad1c 100644 --- a/build/js/custom.min.js +++ b/build/js/custom.min.js @@ -1 +1 @@ -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())}!function(e,t){var n=function(e,t,n){var i;return function(){function c(){n||e.apply(a,o),i=null}var a=this,o=arguments;i?clearTimeout(i):n&&e.apply(a,o),i=setTimeout(c,t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",n(e)):this.trigger(t)}}(jQuery,"smartresize");var CURRENT_URL=window.location.href,$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");$(document).ready(function(){var e=function(){$RIGHT_COL.css("min-height",$(window).height());var e=$BODY.outerHeight(),t=$BODY.hasClass("footer_fixed")?-10:$FOOTER.height(),n=$LEFT_COL.eq(1).height()+$SIDEBAR_FOOTER.height(),i=e1){for(var n=0,i=0;i:first-child"),"+"==$expand.text()?$expand.text("-"):$expand.text("+")})}),"undefined"!=typeof NProgress&&($(document).ready(function(){NProgress.start()}),$(window).on("load",function(){NProgress.done()})); \ No newline at end of file +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())}!function(e,t){var n=function(e,t,n){var i;return function(){function c(){n||e.apply(a,o),i=null}var a=this,o=arguments;i?clearTimeout(i):n&&e.apply(a,o),i=setTimeout(c,t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",n(e)):this.trigger(t)}}(jQuery,"smartresize");var CURRENT_URL=window.location.href,$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");$(document).ready(function(){var e=function(){$RIGHT_COL.css("min-height",$(window).height());var e=$BODY.outerHeight(),t=$BODY.hasClass("footer_fixed")?-10:$FOOTER.height(),n=$LEFT_COL.eq(1).height()+$SIDEBAR_FOOTER.height(),i=e1){for(var n=0,i=0;i:first-child"),"+"==$expand.text()?$expand.text("-"):$expand.text("+")})}),"undefined"!=typeof NProgress&&($(document).ready(function(){NProgress.start()}),$(window).on("load",function(){NProgress.done()})); \ No newline at end of file diff --git a/src/js/custom.js b/src/js/custom.js index cf8e2fc0..404e9275 100644 --- a/src/js/custom.js +++ b/src/js/custom.js @@ -33,27 +33,37 @@ $(document).ready(function() { }; $SIDEBAR_MENU.find('a').on('click', function(ev) { - var $li = $(this).parent(); + var $li = $(this).parent(); + if ($li.is('.active')) { + $li.removeClass('active active-sm'); + $('ul:first', $li).slideUp(function() { + setContentHeight(); + }); + } + else + { + // prevent closing menu if we are on child menu + if (!$li.parent().is('.child_menu')) { + $SIDEBAR_MENU.find('li').removeClass('active active-sm'); + $SIDEBAR_MENU.find('li ul').slideUp(); + }else + { + if ( $BODY.is( ".nav-sm" ) ) + { + if (!$li.parent().is('.child_menu')) { + $SIDEBAR_MENU.find('li').removeClass('active active-sm'); + $SIDEBAR_MENU.find('li ul').slideUp(); + } + } + } + $li.addClass('active'); - if ($li.is('.active')) { - $li.removeClass('active active-sm'); - $('ul:first', $li).slideUp(function() { - setContentHeight(); - }); - } else { - // prevent closing menu if we are on child menu - if (!$li.parent().is('.child_menu')) { - $SIDEBAR_MENU.find('li').removeClass('active active-sm'); - $SIDEBAR_MENU.find('li ul').slideUp(); - } + $('ul:first', $li).slideDown(function() { + + }); + } + }); - $li.addClass('active'); - - $('ul:first', $li).slideDown(function() { - setContentHeight(); - }); - } - }); // toggle small or large menu $MENU_TOGGLE.on('click', function() {