Merge pull request #3835 from Icinga/fix/problem-badges-not-visible-if-sidebar-is-collapsed-3568
ui: Show problem badges in collapsed sidebar
This commit is contained in:
commit
801a6719b7
|
@ -113,6 +113,12 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
|
|||
protected function renderBadge()
|
||||
{
|
||||
if ($count = $this->getCount()) {
|
||||
if ($count > 1000000) {
|
||||
$count = round($count, -6) / 1000000 . 'M';
|
||||
} elseif ($count > 1000) {
|
||||
$count = round($count, -3) / 1000 . 'k';
|
||||
}
|
||||
|
||||
$view = $this->view();
|
||||
return sprintf(
|
||||
'<span title="%s" class="badge state-%s">%s</span>',
|
||||
|
|
|
@ -294,8 +294,24 @@ html.no-js .controls > .tabs {
|
|||
}
|
||||
|
||||
#menu {
|
||||
.badge {
|
||||
display: none;
|
||||
.nav-level-1 {
|
||||
> .badge-nav-item > a {
|
||||
position: relative;
|
||||
|
||||
> .badge {
|
||||
position: absolute;
|
||||
right: .5em;
|
||||
bottom: .25em;
|
||||
font-size: 75%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 4em;
|
||||
}
|
||||
}
|
||||
|
||||
> .nav-item.active > a > .badge {
|
||||
display: unset;
|
||||
}
|
||||
}
|
||||
|
||||
img.icon {
|
||||
|
|
Loading…
Reference in New Issue