BadgeNavigationItemRenderer: Add `$cssClass` on autorefresh

This commit is contained in:
Florian Strohmaier 2022-05-11 15:05:54 +02:00
parent c68fbb662e
commit df788ac0ef
1 changed files with 7 additions and 1 deletions

View File

@ -97,7 +97,13 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
if ($item === null) {
$item = $this->getItem();
}
$item->setCssClass('badge-nav-item');
$cssClass = '';
if ($item->getCssClass() !== null) {
$cssClass = ' ' . $item->getCssClass();
}
$item->setCssClass('badge-nav-item' . $cssClass);
$this->setEscapeLabel(false);
$label = $this->view()->escape($item->getLabel());
$item->setLabel($this->renderBadge() . $label);