$wcfAcpMenuWidth: 150px;
+$wcfAcpSubMenuWidth: 300px;
.layoutBoundary {
margin: 0;
.acpPageContentContainer {
- display: flex;
flex: 1 0 auto;
#content {
.acpPageMenu {
background-color: rgb(50, 92, 132);
- flex: 0 0 $wcfAcpMenuWidth;
+ bottom: 0;
+ left: 0;
text-align: center;
overflow: hidden;
+ position: fixed;
+ top: 50px;
+ width: $wcfAcpMenuWidth;
.acpPageMenuLink {
//background-color: rgb(43, 79, 113);
.acpPageSubMenu {
background-color: rgb(36, 66, 95);
- flex: 0 0 auto;
+ bottom: 0;
+ left: $wcfAcpMenuWidth;
+ overflow: hidden;
+ position: fixed;
+ top: 50px;
}
.acpPageSubMenuCategoryList {
- flex: 0 0 300px;
overflow: hidden;
- width: 300px;
+ width: $wcfAcpSubMenuWidth;
&:not(.active) {
display: none;
color: rgb(44, 62, 80) !important;
}
}
+
+ .pageContainer:not(.acpPageHiddenMenu) {
+ .acpPageContentContainer {
+ padding-left: $wcfAcpMenuWidth;
+ }
+
+ .pageFooter {
+ padding-left: $wcfAcpMenuWidth;
+ }
+ }
+
+ .pageContainer.acpPageSubMenuActive {
+ .acpPageContentContainer,
+ .pageFooter {
+ padding-left: $wcfAcpMenuWidth + $wcfAcpSubMenuWidth;
+ }
+ }
}
@include screen-md-down {
<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}" class="wcfAcp">
<a id="top"></a>
- <div id="pageContainer" class="pageContainer">
+ {assign var=_acpPageSubMenuActive value=false}
+ {assign var=_activeMenuItems value=$__wcf->getACPMenu()->getActiveMenuItems()}
+ {foreach from=$__wcf->getACPMenu()->getMenuItems('') item=_sectionMenuItem}
+ {if $_sectionMenuItem->menuItem|in_array:$_activeMenuItems}{assign var=_acpPageSubMenuActive value=true}{/if}
+ {/foreach}
+ <div id="pageContainer" class="pageContainer{if !PACKAGE_ID || !$__wcf->user->userID} acpPageHiddenMenu{elseif $_acpPageSubMenuActive} acpPageSubMenuActive{/if}">
{event name='beforePageHeader'}
{include file='pageHeader'}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Acp/Ui/Page/Menu
*/
-define(['Dictionary', 'EventHandler'], function(Dictionary, EventHandler) {
+define(['Dictionary', 'EventHandler', 'perfect-scrollbar', 'Ui/Screen'], function(Dictionary, EventHandler, perfectScrollbar, UiScreen) {
"use strict";
+ var _acpPageMenu = elById('acpPageMenu');
+ var _acpPageSubMenu = elById('acpPageSubMenu');
var _activeMenuItem = '';
var _menuItems = new Dictionary();
var _menuItemContainers = new Dictionary();
+ var _pageContainer = elById('pageContainer');
+ var _perfectScrollbarActive = false;
/**
* @exports WoltLabSuite/Core/Acp/Ui/Page/Menu
elBySelAll('.acpPageSubMenuCategoryList', null, function(container) {
_menuItemContainers.set(elData(container, 'menu-item'), container);
});
+
+ var enablePerfectScrollbar = function () {
+ var options = {
+ wheelPropagation: false,
+ swipePropagation: false,
+ suppressScrollX: true
+ };
+
+ perfectScrollbar.initialize(_acpPageMenu, options);
+ perfectScrollbar.initialize(_acpPageSubMenu, options);
+
+ _perfectScrollbarActive = true;
+ };
+
+ UiScreen.on('screen-lg', {
+ match: enablePerfectScrollbar,
+ unmatch: function () {
+ perfectScrollbar.destroy(_acpPageMenu);
+ perfectScrollbar.destroy(_acpPageSubMenu);
+
+ _perfectScrollbarActive = true;
+ },
+ setup: enablePerfectScrollbar
+ });
+
+ window.addEventListener('resize', function () {
+ if (_perfectScrollbarActive) {
+ perfectScrollbar.update(_acpPageMenu);
+ perfectScrollbar.update(_acpPageSubMenu);
+ }
+ })
},
/**
var link = event.currentTarget;
var menuItem = elData(link, 'menu-item');
+ var acpPageSubMenuActive = false;
// remove active marking from currently active menu
if (_activeMenuItem) {
_menuItemContainers.get(menuItem).classList.add('active');
_activeMenuItem = menuItem;
+ acpPageSubMenuActive = true;
+ }
+
+ _pageContainer.classList[(acpPageSubMenuActive ? 'add' : 'remove')]('acpPageSubMenuActive');
+ if (_perfectScrollbarActive) {
+ _acpPageSubMenu.scrollTop = 0;
+ perfectScrollbar.update(_acpPageSubMenu);
}
EventHandler.fire('com.woltlab.wcf.AcpMenu', 'resize');