Fix badge markup in the BadgeMenuItemRenderer

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-27 14:16:36 +02:00
parent 4c798d4e04
commit 30ed3ad760
1 changed files with 5 additions and 4 deletions

View File

@ -42,7 +42,7 @@ abstract class BadgeMenuItemRenderer extends MenuItemRenderer
*/
public function render(Menu $menu)
{
return $this->renderBadge() . $this->createLink($menu);
return '<div class="clearfix">' . $this->renderBadge() . $this->createLink($menu) . '</div>';
}
/**
@ -53,10 +53,11 @@ abstract class BadgeMenuItemRenderer extends MenuItemRenderer
protected function renderBadge()
{
if ($count = $this->getCount()) {
$view = $this->getView();
return sprintf(
'<div title="%s" class="badge-container"><span class="badge badge-%s">%s</span></div>',
$this->getView()->escape($this->getTitle()),
$this->getView()->escape($this->getState()),
'<span title="%s" class="badge pull-right state-%s">%s</span>',
$view->escape($this->getTitle()),
$view->escape($this->getState()),
$count
);
}