Fixed notification update on session keep alive
authorAlexander Ebert <ebert@woltlab.com>
Sun, 30 Nov 2014 00:47:58 +0000 (01:47 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 30 Nov 2014 00:47:58 +0000 (01:47 +0100)
wcfsetup/install/files/js/WCF.User.js

index cd473f9ef79f4c5a64d380d616e65bba8c9493c3..493dd20db4077c04217082fc8cb07ef8f8e72f1e 100644 (file)
@@ -1589,8 +1589,7 @@ WCF.Notification.UserPanel = WCF.UserPanel.extend({
        },
        
        _removeMarkAllAsConfirmed: function() {
-               $('#userNotificationsMarkAllAsConfirmed').prev('.dropdownDivider').remove();
-               $('#userNotificationsMarkAllAsConfirmed').remove();
+               $('#userNotificationsMarkAllAsConfirmed').hide().prev('.dropdownDivider').hide();
        },
        
        /**
@@ -1603,14 +1602,14 @@ WCF.Notification.UserPanel = WCF.UserPanel.extend({
                WCF.Dropdown.close('userNotifications');
                
                // revert dropdown to initial state
-               var $dropdownMenu = WCF.Dropdown.getDropdownMenu('userNotifications');
-               var $item = $dropdownMenu.find('.dropdownDivider:eq(0)');
-               $item.prevAll().remove();
-               $('<li class="jsDropdownPlaceholder"><span>' + WCF.Language.get('wcf.global.loading') + '</span></li>').insertBefore($item);
-               this._didLoad = false;
+               this._resetList();
                
                // update badge
                this._updateBadge(count);
+               
+               if (parseInt(count) > 0) {
+                       $('#userNotificationsMarkAllAsConfirmed').show().prev('.dropdownDivider').show();
+               }
        }
 });