From: Alexander Ebert Date: Thu, 8 Jun 2017 08:23:47 +0000 (+0200) Subject: Hide mobile user panel icon if there is nothing to display X-Git-Tag: 3.1.0_Alpha_1~410 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3bc7d69060a93ce1ce3162a81552bbdaf88b3239;p=GitHub%2FWoltLab%2FWCF.git Hide mobile user panel icon if there is nothing to display See #2292 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js index 91ee05ae09..60aef4b315 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js @@ -18,6 +18,13 @@ define(['Core', 'EventHandler', './Abstract'], function(Core, EventHandler, UiPa * Initializes the touch-friendly fullscreen user menu. */ init: function() { + // check if user menu is actually empty + var menu = elBySel('#pageUserMenuMobile > .menuOverlayItemList'); + if (menu.childElementCount === 1 && menu.children[0].classList.contains('menuOverlayTitle')) { + elBySel('#pageHeader .userPanel').classList.add('hideUserPanel'); + return; + } + UiPageMenuUser._super.prototype.init.call( this, 'com.woltlab.wcf.UserMenuMobile', diff --git a/wcfsetup/install/files/style/layout/pageHeader.scss b/wcfsetup/install/files/style/layout/pageHeader.scss index 45b249fbad..a18c4c44ba 100644 --- a/wcfsetup/install/files/style/layout/pageHeader.scss +++ b/wcfsetup/install/files/style/layout/pageHeader.scss @@ -503,6 +503,10 @@ } } + .userPanel.hideUserPanel::before { + visibility: hidden !important; + } + .pageHeaderSearch { left: 0 !important; right: 0 !important;