From: Marcel Werk Date: Mon, 16 Aug 2021 13:08:54 +0000 (+0200) Subject: Mark as read doesn't removed the badge from submenu entries X-Git-Tag: 5.4.5_RC_1~40 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f8f0789b990f8d16f37a12c25c3d30f9a832940;p=GitHub%2FWoltLab%2FWCF.git Mark as read doesn't removed the badge from submenu entries --- diff --git a/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts b/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts index abef38f0bf..726c44b7be 100644 --- a/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts +++ b/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts @@ -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(); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js index 947426a19e..b2fdfd54b8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js @@ -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;