{/capture}
{if $__sidebarRightContent|trim}
- <aside class="sidebar boxesSidebarRight">
+ <aside class="sidebar boxesSidebarRight" data-show-sidebar="{lang}wcf.global.button.showSidebar{/lang}" data-hide-sidebar="{lang}wcf.global.button.hideSidebar{/lang}">
<div class="boxContainer">
{if MODULE_WCF_AD && $__disableAds|empty && $__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.top')}
<div class="box boxBorderless">
<section id="main" class="main" role="main"{if !$__mainItemScope|empty} {@$__mainItemScope}{/if}>
<div class="layoutBoundary">
{hascontent}
- <aside class="sidebar boxesSidebarLeft">
+ <aside class="sidebar boxesSidebarLeft{if !$__sidebarLeftHasMenu|empty || $__wcf->getBoxHandler()->sidebarLeftHasMenu()} boxesSidebarLeftHasMenu{/if}" data-show-sidebar="{lang}wcf.global.button.showSidebar{/lang}" data-hide-sidebar="{lang}wcf.global.button.hideSidebar{/lang}" data-show-navigation="{lang}wcf.global.button.showNavigation{/lang}" data-hide-navigation="{lang}wcf.global.button.hideNavigation{/lang}">
<div class="boxContainer">
{content}
{event name='boxesSidebarLeftTop'}
{include file='userMenuSidebar'}
-{include file='header' __disableAds=true}
+{include file='header' __disableAds=true __sidebarLeftHasMenu=true}
{include file='formError'}
var _pageMenuMain = null;
var _pageMenuUser = null;
var _messageGroups = null;
+ var _sidebars = [];
+ var _sidebarXsEnabled = false;
/**
* @exports WoltLabSuite/Core/Ui/Mobile
_main = elById('main');
+ elBySelAll('.sidebar', undefined, function (sidebar) {
+ _sidebars.push(sidebar);
+ });
+
if (Environment.touch()) {
document.documentElement.classList.add('touch');
}
unmatch: this.disableShadow.bind(this),
setup: this.enableShadow.bind(this)
});
+
+ UiScreen.on('screen-xs', {
+ match: this._enableSidebarXS.bind(this),
+ unmatch: this._disableSidebarXS.bind(this),
+ setup: this._setupSidebarXS.bind(this)
+ });
},
/**
parent.classList.remove('mobileLinkShadowContainer');
}
}
+ },
+
+ _enableSidebarXS: function() {
+ _sidebarXsEnabled = true;
+ },
+
+ _disableSidebarXS: function() {
+ _sidebarXsEnabled = false;
+
+ _sidebars.forEach(function (sidebar) {
+ sidebar.classList.remove('open');
+ });
+ },
+
+ _setupSidebarXS: function() {
+ _sidebars.forEach(function (sidebar) {
+ sidebar.addEventListener('mousedown', function(event) {
+ if (_sidebarXsEnabled && event.target === sidebar) {
+ event.preventDefault();
+
+ sidebar.classList.toggle('open');
+ }
+ });
+ });
+
+ _sidebarXsEnabled = true;
}
};
});
}
}
+ /**
+ * Returns true if the left sidebar contains at least one visible menu.
+ *
+ * @return boolean
+ * @since 3.1
+ */
+ public function sidebarLeftHasMenu() {
+ foreach ($this->getBoxes('sidebarLeft') as $box) {
+ if ($box->getMenu() && $box->getMenu()->hasContent()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/**
* Disables the loading of the box layout for the active page.
*/
padding-right: 10px;
}
+@include screen-xs {
+ .boxesSidebarLeft,
+ .boxesSidebarRight {
+ pointer-events: none;
+
+ > .boxContainer {
+ pointer-events: all;
+ }
+
+ &:not(.open) > .boxContainer {
+ display: none;
+ }
+
+ &::before {
+ background-color: $wcfSidebarBackground;
+ color: $wcfSidebarLink;
+ /* DEBUG */
+ content: attr(data-show-sidebar);
+ display: block;
+ padding: 10px 0;
+ pointer-events: all;
+ text-align: center;
+ }
+
+ &.open::before {
+ content: attr(data-hide-sidebar);
+ margin-bottom: 20px;
+ }
+ }
+
+ .boxesSidebarLeft.boxesSidebarLeftHasMenu {
+ &::before {
+ content: attr(data-show-navigation);
+ }
+
+ &.open::before {
+ content: attr(data-hide-navigation);
+ }
+ }
+}
+
/* styling for boxes in <contentTop>/<contentBottom> position */
.boxesContentTop,
.boxesContentBottom {
<item name="wcf.global.select"><![CDATA[Auswählen]]></item>
<item name="wcf.global.sorting"><![CDATA[Sortierung]]></item>
<item name="wcf.global.fontAwesome.selectIcon"><![CDATA[Icon auswählen]]></item>
+ <item name="wcf.global.button.hideNavigation"><![CDATA[Navigation verbergen]]></item>
+ <item name="wcf.global.button.showNavigation"><![CDATA[Navigation anzeigen]]></item>
+ <item name="wcf.global.button.hideSidebar"><![CDATA[Sidebar verbergen]]></item>
+ <item name="wcf.global.button.showSidebar"><![CDATA[Sidebar anzeigen]]></item>
</category>
<category name="wcf.global.form">
<item name="wcf.global.select"><![CDATA[Select]]></item>
<item name="wcf.global.sorting"><![CDATA[Sorting]]></item>
<item name="wcf.global.fontAwesome.selectIcon"><![CDATA[Select Icon]]></item>
+ <item name="wcf.global.button.hideNavigation"><![CDATA[Hide Navigation]]></item>
+ <item name="wcf.global.button.showNavigation"><![CDATA[Show Navigation]]></item>
+ <item name="wcf.global.button.hideSidebar"><![CDATA[Hide Sidebar]]></item>
+ <item name="wcf.global.button.showSidebar"><![CDATA[Show Sidebar]]></item>
</category>
<category name="wcf.global.form">