From: Matthias Schmidt Date: Sun, 25 Sep 2016 08:41:14 +0000 (+0200) Subject: Resolve todos in `WCF.Moderation.Queue.MarkAllAsRead._success` X-Git-Tag: 3.0.0_Beta_2~155 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b48b7d04e207283676a91d8391fbeb495c5e525;p=GitHub%2FWoltLab%2FWCF.git Resolve todos in `WCF.Moderation.Queue.MarkAllAsRead._success` --- 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]; } };