From 0f8f0789b990f8d16f37a12c25c3d30f9a832940 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 16 Aug 2021 15:08:54 +0200 Subject: [PATCH] Mark as read doesn't removed the badge from submenu entries --- ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts | 3 +-- .../files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) 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; -- 2.20.1