Mark as read doesn't removed the badge from submenu entries
authorMarcel Werk <burntime@woltlab.com>
Mon, 16 Aug 2021 13:08:54 +0000 (15:08 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 16 Aug 2021 13:08:54 +0000 (15:08 +0200)
ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js

index abef38f0bfdb1bb6c4fa2c5439cabf448e3b709a..726c44b7be2f37b676eb5d827efe74351bcbc2a2 100644 (file)
@@ -28,8 +28,7 @@ class UiArticleMarkAllAsRead implements AjaxCallbackObject {
   _ajaxSuccess(): void {
     /* remove obsolete badges */
     // main menu
-    const badge = document.querySelector(".mainMenu .active .badge");
-    if (badge) badge.remove();
+    document.querySelectorAll(".mainMenu .active .badge").forEach((badge) => badge.remove());
     // mobile page menu badge
     document.querySelectorAll(".pageMainMenuMobile .active").forEach((container) => {
       container.closest(".menuOverlayItem")?.querySelector(".badge")?.remove();
index 947426a19e3d94d83b484993af9cb0208e633723..b2fdfd54b8ae7a166be65e3359e6c41deef64874 100644 (file)
@@ -26,9 +26,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Event/Handler"], fun
         _ajaxSuccess() {
             /* remove obsolete badges */
             // main menu
-            const badge = document.querySelector(".mainMenu .active .badge");
-            if (badge)
-                badge.remove();
+            document.querySelectorAll(".mainMenu .active .badge").forEach((badge) => badge.remove());
             // mobile page menu badge
             document.querySelectorAll(".pageMainMenuMobile .active").forEach((container) => {
                 var _a, _b;