Hide mobile user panel icon if there is nothing to display
authorAlexander Ebert <ebert@woltlab.com>
Thu, 8 Jun 2017 08:23:47 +0000 (10:23 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 8 Jun 2017 08:23:47 +0000 (10:23 +0200)
See #2292

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/User.js
wcfsetup/install/files/style/layout/pageHeader.scss

index 91ee05ae09b9ce7d46c1c6903b617264dfbd3b18..60aef4b3158dc7e52f1c775ce910dab87d6fa33d 100644 (file)
@@ -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',
index 45b249fbada63d98a7114e39a1aa2fc38ce09f0a..a18c4c44ba0a3bef4f2d1fe7f3f974ee7af5ae2e 100644 (file)
                }
        }
        
+       .userPanel.hideUserPanel::before {
+               visibility: hidden !important;
+       }
+       
        .pageHeaderSearch {
                left: 0 !important;
                right: 0 !important;