Improved the menu overflow behavior
authorAlexander Ebert <ebert@woltlab.com>
Tue, 28 Dec 2021 16:41:06 +0000 (17:41 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 28 Dec 2021 16:41:06 +0000 (17:41 +0100)
ts/WoltLabSuite/Core/Ui/Page/Menu/Main.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js
wcfsetup/install/files/style/ui/pageMenu.scss

index aa6433d12d9b6184335e9c7c74ba14509bdfb073..282274bc13c8379a77952953e91a69a855aaf381 100644 (file)
@@ -99,7 +99,7 @@ export class PageMenuMain implements PageMenuProvider {
     container.classList.add("pageMenuMainContainer");
     container.addEventListener("scroll", () => this.updateOverflowIndicator(container), { passive: true });
 
-    container.append(...this.buildMainMenu());
+    container.append(this.buildMainMenu());
 
     const footerMenu = this.buildFooterMenu();
     if (footerMenu) {
@@ -130,14 +130,14 @@ export class PageMenuMain implements PageMenuProvider {
     this.refreshUnreadIndicator();
   }
 
-  private buildMainMenu(): HTMLElement[] {
+  private buildMainMenu(): HTMLElement {
     const boxMenu = this.mainMenu.querySelector(".boxMenu") as HTMLElement;
 
     const nav = this.buildMenu(boxMenu);
     nav.setAttribute("aria-label", window.PAGE_TITLE);
     nav.setAttribute("role", "navigation");
 
-    return [nav];
+    return nav;
   }
 
   private buildFooterMenu(): HTMLElement | null {
index 04ffcba6b8c47aeebb805d64a4b5bf1a3bb5496a..1c36140212cbbe5de56cb07f223a4928f6dc68ca 100644 (file)
@@ -71,7 +71,7 @@ define(["require", "exports", "tslib", "./Container", "../../../Language", "../.
             const container = document.createElement("div");
             container.classList.add("pageMenuMainContainer");
             container.addEventListener("scroll", () => this.updateOverflowIndicator(container), { passive: true });
-            container.append(...this.buildMainMenu());
+            container.append(this.buildMainMenu());
             const footerMenu = this.buildFooterMenu();
             if (footerMenu) {
                 container.append(footerMenu);
@@ -99,7 +99,7 @@ define(["require", "exports", "tslib", "./Container", "../../../Language", "../.
             const nav = this.buildMenu(boxMenu);
             nav.setAttribute("aria-label", window.PAGE_TITLE);
             nav.setAttribute("role", "navigation");
-            return [nav];
+            return nav;
         }
         buildFooterMenu() {
             const box = document.querySelector('.box[data-box-identifier="com.woltlab.wcf.FooterMenu"]');
index 77ab2f04ff15f83efdba87e03220ac7caaffe5b8..ca902ae3ec5b79172fe147dc9ced2e1707fc1ed4 100644 (file)
        padding: 0 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
+
+       &:hover {
+               color: inherit;
+       }
 }
 
 .pageMenuMainItemCounter {
 }
 
 @include screen-sm-down {
-       .pageMenuContent {
+       .pageMenuMainNavigation:last-child {
+               /* Gap to prevent conflicts with the UI elements of touch browsers. */
+               margin-bottom: 30px;
+       }
+
+       .pageMenuUserTabContainer {
                /* Gap to prevent conflicts with the UI elements of touch browsers. */
                padding-bottom: 30px;
        }