/* * Custom UI script for custom sidebar */ $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 60) { $('#main-view-menu').addClass("scrolled"); } else { $('#main-view-menu').removeClass("scrolled"); } }); $(document).ready(function() { var container = $("ul#emails_menu"); container.hide(); $("li.adb-menu").click(function () { container.show(); }); var containerb = $("ul#config_menu"); containerb.hide(); $("li.adb-menu-config").click(function () { containerb.show(); }); }); $(document).mouseup(function(e) { var container = $("ul#emails_menu"); // if the target of the click isn't the container nor a descendant of the container if (!container.is(e.target) && container.has(e.target).length === 0) { container.hide(); } var containerb = $("ul#config_menu"); // if the target of the click isn't the container nor a descendant of the container if (!containerb.is(e.target) && containerb.has(e.target).length === 0) { containerb.hide(); } });