/** * source file: * src/js/custom/modules/navmenu.js */ if (typeof B2E === "undefined"){ var B2E = {}; } B2E.navmenu = (function(){ var self = {}, _config, _toggleSubLevel, _switchGlobalAndSectionMenu, _updateLayoutClass, _init; _config = function(){ self.$layout = $('.layout'); self.$navMain = $('.nav-main'); self.$navMenu = self.$navMain.find('.navmenu-nav'); self.$showNavSectionBtn = $('.btn-show-nav-section'); self.$showNavGlobalBtn = $('.btn-show-nav-global'); self.$navWrap = $('.nav-wrap'); }; _toggleSubLevel = function(){ self.$navMenu.metisMenu({ toggle: false, triggerElement: '.nav-accordion-toggle' }); }; _switchGlobalAndSectionMenu = function(){ self.$showNavGlobalBtn.click(function(){ self.$navWrap.addClass('show-nav-global'); }); self.$showNavSectionBtn.click(function(){ self.$navWrap.removeClass('show-nav-global'); }); }; _updateLayoutClass = function(){ self.$navMain.on('show.bs.offcanvas', function (e) { self.$layout.addClass('navmenu-opened'); }); self.$navMain.on('hidden.bs.offcanvas', function (e) { self.$layout.removeClass('navmenu-opened'); }); $(window).on('resize', function(){ if(!$('.canvas-slid').length){ self.$layout.removeClass('navmenu-opened'); } }); }; _init = function(){ _config(); _toggleSubLevel(); _switchGlobalAndSectionMenu(); _updateLayoutClass(); }; return{ init: _init }; })(); $(document).ready(function(){ B2E.navmenu.init(); }); /** * source file: * src/js/custom/modules/widgets-bar.js */ if (typeof B2E === "undefined"){ var B2E = {}; } B2E.widgetsBar = (function(){ var self = {}, _config, _autoHideWidgetsBar, _init; _config = function(){ self.$widgetsBar = $('.widgets-bar'); }; _autoHideWidgetsBar = function(){ $(document).on('click touchstart', '.content-main, [data-toggle=offcanvas]', function (){ self.$widgetsBar.collapse('hide'); }); }; _init = function(){ _config(); _autoHideWidgetsBar(); }; return{ init: _init }; })(); $(document).ready(function(){ B2E.widgetsBar.init(); });