From: Marcel Werk Date: Thu, 5 Aug 2021 15:48:20 +0000 (+0200) Subject: Mark as read doesn't removed the badge in the mobile menu X-Git-Tag: 5.4.3~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=16709d43f800b3043352425d1061c3bab66ab7b0;p=GitHub%2FWoltLab%2FWCF.git Mark as read doesn't removed the badge in the mobile menu --- diff --git a/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts b/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts index b5d47380c6..abef38f0bf 100644 --- a/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts +++ b/ts/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.ts @@ -10,6 +10,7 @@ import * as Ajax from "../../Ajax"; import { AjaxCallbackObject, AjaxCallbackSetup } from "../../Ajax/Data"; +import * as EventHandler from "../../Event/Handler"; class UiArticleMarkAllAsRead implements AjaxCallbackObject { constructor() { @@ -29,9 +30,15 @@ class UiArticleMarkAllAsRead implements AjaxCallbackObject { // main menu const badge = document.querySelector(".mainMenu .active .badge"); if (badge) badge.remove(); + // mobile page menu badge + document.querySelectorAll(".pageMainMenuMobile .active").forEach((container) => { + container.closest(".menuOverlayItem")?.querySelector(".badge")?.remove(); + }); // article list document.querySelectorAll(".contentItemList .contentItemBadgeNew").forEach((el) => el.remove()); + + EventHandler.fire("com.woltlab.wcf.MainMenuMobile", "updateButtonState"); } _ajaxSetup(): ReturnType { 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 e4066ccd3c..947426a19e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Article/MarkAllAsRead.js @@ -7,11 +7,12 @@ * @module WoltLabSuite/Core/Ui/Article/MarkAllAsRead * @woltlabExcludeBundle tiny */ -define(["require", "exports", "tslib", "../../Ajax"], function (require, exports, tslib_1, Ajax) { +define(["require", "exports", "tslib", "../../Ajax", "../../Event/Handler"], function (require, exports, tslib_1, Ajax, EventHandler) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.init = void 0; Ajax = tslib_1.__importStar(Ajax); + EventHandler = tslib_1.__importStar(EventHandler); class UiArticleMarkAllAsRead { constructor() { document.querySelectorAll(".markAllAsReadButton").forEach((button) => { @@ -28,8 +29,14 @@ define(["require", "exports", "tslib", "../../Ajax"], function (require, exports const badge = document.querySelector(".mainMenu .active .badge"); if (badge) badge.remove(); + // mobile page menu badge + document.querySelectorAll(".pageMainMenuMobile .active").forEach((container) => { + var _a, _b; + (_b = (_a = container.closest(".menuOverlayItem")) === null || _a === void 0 ? void 0 : _a.querySelector(".badge")) === null || _b === void 0 ? void 0 : _b.remove(); + }); // article list document.querySelectorAll(".contentItemList .contentItemBadgeNew").forEach((el) => el.remove()); + EventHandler.fire("com.woltlab.wcf.MainMenuMobile", "updateButtonState"); } _ajaxSetup() { return {