Improper restore of navigation menu icons
authorAlexander Ebert <ebert@woltlab.com>
Wed, 22 Dec 2021 14:07:29 +0000 (15:07 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 22 Dec 2021 14:07:29 +0000 (15:07 +0100)
ts/WoltLabSuite/Core/Ui/Page/Menu/Main.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js

index 68194d366c36c0a7ebee1504826930334ae565a1..74e3b851473f30d48beffa122b877460cd1238f9 100644 (file)
@@ -82,6 +82,8 @@ class UiPageMenuMain extends UiPageMenuAbstract {
 
       let item = this.title.nextElementSibling;
       while (item && item.classList.contains("menuOverlayItemOption")) {
+        const nextSibling = item.nextElementSibling;
+
         item.classList.remove("menuOverlayItem", "menuOverlayItemOption");
         item.removeEventListener("click", (ev) => {
           ev.stopPropagation();
@@ -96,9 +98,9 @@ class UiPageMenuMain extends UiPageMenuAbstract {
         link.children[1].classList.add("invisible");
         link.children[1].classList.remove("menuOverlayItemTitle");
 
-        this.navigationList.appendChild(item);
+        this.navigationList.prepend(item);
 
-        item = item.nextElementSibling;
+        item = nextSibling;
       }
     }
 
index 6ce989588bc0b998b61aaaea32242d4d44295e94..f4092e97dd6461cca29c8c856693e2af1f590cc5 100644 (file)
@@ -64,6 +64,7 @@ define(["require", "exports", "tslib", "../../../Core", "../../../Dom/Util", "..
                 Util_1.default.hide(this.title);
                 let item = this.title.nextElementSibling;
                 while (item && item.classList.contains("menuOverlayItemOption")) {
+                    const nextSibling = item.nextElementSibling;
                     item.classList.remove("menuOverlayItem", "menuOverlayItemOption");
                     item.removeEventListener("click", (ev) => {
                         ev.stopPropagation();
@@ -74,8 +75,8 @@ define(["require", "exports", "tslib", "../../../Core", "../../../Dom/Util", "..
                     link.classList.remove("box24");
                     link.children[1].classList.add("invisible");
                     link.children[1].classList.remove("menuOverlayItemTitle");
-                    this.navigationList.appendChild(item);
-                    item = item.nextElementSibling;
+                    this.navigationList.prepend(item);
+                    item = nextSibling;
                 }
             }
             return true;