Commit aec9c1eb by benjaoming

fix wrongly resetting notification badge color at every update

parent 25ee8b7f
...@@ -8,8 +8,10 @@ function notify_update() { ...@@ -8,8 +8,10 @@ function notify_update() {
if (data.success) { if (data.success) {
$('.notification-cnt').html(data.total_count); $('.notification-cnt').html(data.total_count);
if (data.objects.length> 0) { if (data.objects.length> 0) {
$('.notification-cnt').addClass('badge-important');
$('.notifications-empty').hide(); $('.notifications-empty').hide();
}
if (data.total_count > 0) {
$('.notification-cnt').addClass('badge-important');
} else { } else {
$('.notification-cnt').removeClass('badge-important'); $('.notification-cnt').removeClass('badge-important');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment