Resolve todos in `WCF.Moderation.Queue.MarkAllAsRead._success`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 25 Sep 2016 08:41:14 +0000 (10:41 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 25 Sep 2016 08:41:17 +0000 (10:41 +0200)
wcfsetup/install/files/js/WCF.Moderation.js
wcfsetup/install/files/js/WCF.js

index f6af5bf8948938d65f4baa78306473e942b758b0..e8cd8aa5203060e8deafbdb135d3bb7af3dc96c9 100644 (file)
@@ -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');
index b09be6d30a8af45485f27d65448453bf96fbf3ad..6c201d41a63f3b04c0b276bcaf3ffc48b310b56f 100755 (executable)
@@ -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];
        }
 };