mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: notification read count doesn't decrement in menu bar (#7750)
* fix: notification read count doesn't decrement in menu bar * also remove red color if we reach 0
This commit is contained in:
@@ -626,7 +626,7 @@ if (empty($notifications['count']) && empty($notifications['sticky_count'])) {
|
||||
} else {
|
||||
$class = 'badge-danger';
|
||||
}
|
||||
echo('<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-user fa-fw fa-lg fa-nav-icons" aria-hidden="true"></i> <span class="visible-xs-inline-block">User</span><span class="badge badge-navbar-user '.$class.'">'.($notifications['sticky_count']+$notifications['count']).'</span></a>');
|
||||
echo('<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-user fa-fw fa-lg fa-nav-icons" aria-hidden="true"></i> <span class="visible-xs-inline-block">User</span><span class="badge badge-navbar-user count-notif '.$class.'">'.($notifications['sticky_count']+$notifications['count']).'</span></a>');
|
||||
?>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="preferences/"><i class="fa fa-cog fa-fw fa-lg" aria-hidden="true"></i> My Settings</a></li>
|
||||
|
@@ -221,7 +221,14 @@ $(function() {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
$("#"+notif).parent().parent().parent().fadeOut();
|
||||
$(".count-notif").each(function(){
|
||||
this.innerHTML = this.innerHTML-1;
|
||||
var new_count = this.innerHTML-1;
|
||||
this.innerHTML = new_count;
|
||||
if (new_count == 0) {
|
||||
$this = $(this);
|
||||
if ($this.hasClass('badge-danger')) {
|
||||
$this.removeClass('badge-danger');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user