$('<li class="dropdownDivider" />').insertAfter($insertAfter);
}
}
+
+ var $badge = this._container.find('.badge');
+ if (!$badge.length) {
+ this._removeMarkAllAsConfirmed();
+ }
},
/**
case 'markAllAsConfirmed':
this._resetList();
- // fall through
+
+ this._updateBadge(0);
+ this._removeMarkAllAsConfirmed();
+ break;
+
case 'getOutstandingNotifications':
if (!data.returnValues || !data.returnValues.template) {
- $('#userNotificationsMarkAllAsConfirmed').prev('.dropdownDivider').remove();
- $('#userNotificationsMarkAllAsConfirmed').remove();
+ this._removeMarkAllAsConfirmed();
}
this._super(data, textStatus, jqXHR);
if (this._favico !== null) {
this._favico.badge(count);
}
+
+ if (count === 0) {
+ this._removeMarkAllAsConfirmed();
+ }
},
/**
$('<li class="jsDropdownPlaceholder"><span>' + WCF.Language.get('wcf.global.loading') + '</span></li>').prependTo($dropdownMenu);
+ // remove double separators
+ $dropdownMenu.children('.dropdownDivider + .dropdownDivider').remove();
+
this._didLoad = false;
},
+ _removeMarkAllAsConfirmed: function() {
+ $('#userNotificationsMarkAllAsConfirmed').prev('.dropdownDivider').remove();
+ $('#userNotificationsMarkAllAsConfirmed').remove();
+ },
+
/**
* Updates user notification count.
*