Sha256: 5cb1c79c32e4282c45bad46d3ba4d47acc5377e6cc57294a5b3c33acb191cc4b
Contents?: true
Size: 1.68 KB
Versions: 16
Compression:
Stored size: 1.68 KB
Contents
document.addEventListener("spree:load", function() { var body = $('body') var modalBackdrop = $('#multi-backdrop') // Fail safe on screen resize var resizeTimer; window.addEventListener('resize', function() { document.body.classList.remove('modal-open', 'sidebar-open', 'contextualSideMenu-open'); document.body.classList.add('resize-animation-stopper'); clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { document.body.classList.remove('resize-animation-stopper'); }, 400); }); function closeAllMenus() { body.removeClass() body.addClass('admin') modalBackdrop.removeClass('show') } modalBackdrop.click(closeAllMenus) // Main Menu Functionality var sidebarOpen = $('#sidebar-open') var sidebarClose = $('#sidebar-close') var activeItem = $('#main-sidebar').find('.selected') activeItem.closest('.nav-sidebar').addClass('active-option') activeItem.closest('.nav-pills').addClass('in show') function openMenu() { closeAllMenus() body.addClass('sidebar-open modal-open') modalBackdrop.addClass('show') } sidebarOpen.click(openMenu) sidebarClose.click(closeAllMenus) // Contextual Sidebar Menu var contextualSidebarMenuToggle = $('#contextual-menu-toggle') var contextualSidebarMenuClose = $('#contextual-menu-close') function toggleContextualMenu() { if (document.body.classList.contains('contextualSideMenu-open')) { closeAllMenus() } else { closeAllMenus() body.addClass('contextualSideMenu-open modal-open') modalBackdrop.addClass('show') } } contextualSidebarMenuToggle.click(toggleContextualMenu) contextualSidebarMenuClose.click(toggleContextualMenu) })
Version data entries
16 entries across 16 versions & 1 rubygems