From 5b48b7d04e207283676a91d8391fbeb495c5e525 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 25 Sep 2016 10:41:14 +0200 Subject: [PATCH] Resolve todos in `WCF.Moderation.Queue.MarkAllAsRead._success` --- wcfsetup/install/files/js/WCF.Moderation.js | 12 +++++++++--- wcfsetup/install/files/js/WCF.js | 10 ++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Moderation.js b/wcfsetup/install/files/js/WCF.Moderation.js index f6af5bf894..e8cd8aa520 100644 --- a/wcfsetup/install/files/js/WCF.Moderation.js +++ b/wcfsetup/install/files/js/WCF.Moderation.js @@ -374,10 +374,16 @@ WCF.Moderation.Queue.MarkAllAsRead = Class.extend({ * @param jQuery jqXHR */ _success: function(data, textStatus, jqXHR) { - // @todo fix dropdown + // update dropdown + var dropdown = WCF.Dropdown.Interactive.Handler.getDropdown('outstandingModeration'); + if (dropdown) { + dropdown.getLinkList().find('.interactiveDropdownItemMarkAllAsRead').remove(); + dropdown.getItemList().find('.interactiveDropdownItemMarkAsRead').remove(); + } + + // remove badge in userpanel + $('#outstandingModeration .badgeUpdate').remove(); - // @todo remove badge in userpanel - // fix moderation list var $moderationList = $('.moderationList'); $moderationList.find('.new').removeClass('new'); diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index b09be6d30a..6c201d41a6 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1071,6 +1071,16 @@ WCF.Dropdown.Interactive.Handler = { } return null; + }, + + /** + * Returns the dropdown with given identifier or `undefined` if no such dropdown exists. + * + * @param string identifier + * @return {WCF.Dropdown.Interactive.Instance?} + */ + getDropdown: function(identifier) { + return this._dropdownMenus[identifier]; } }; -- 2.20.1