Fixes #16 - Adds tooltip to counter in navigation using 'counterLabel' property
This commit is contained in:
parent
cbf49e294f
commit
7bcec1bd99
|
|
@ -46,6 +46,7 @@ class NavigationManager
|
||||||
'icon' => null,
|
'icon' => null,
|
||||||
'url' => null,
|
'url' => null,
|
||||||
'counter' => null,
|
'counter' => null,
|
||||||
|
'counterLabel'=> null,
|
||||||
'attributes' => [],
|
'attributes' => [],
|
||||||
'permissions' => []
|
'permissions' => []
|
||||||
];
|
];
|
||||||
|
|
@ -159,6 +160,7 @@ class NavigationManager
|
||||||
* - permissions - an array of permissions the back-end user should have, optional.
|
* - permissions - an array of permissions the back-end user should have, optional.
|
||||||
* - counter - an optional numeric value to output near the menu icon. The value should be
|
* - counter - an optional numeric value to output near the menu icon. The value should be
|
||||||
* a number or a callable returning a number.
|
* a number or a callable returning a number.
|
||||||
|
* - counterLabel - an optional string value to describe the numeric reference in counter.
|
||||||
* @param string $owner Specifies the menu items owner plugin or module in the format Author.Plugin.
|
* @param string $owner Specifies the menu items owner plugin or module in the format Author.Plugin.
|
||||||
* @param array $definitions An array of the menu item definitions.
|
* @param array $definitions An array of the menu item definitions.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
$context = BackendMenu::getContext();
|
$context = BackendMenu::getContext();
|
||||||
|
|
||||||
$contextSidenav = BackendMenu::getContextSidenavPartial($context->owner, $context->mainMenuCode);
|
$contextSidenav = BackendMenu::getContextSidenavPartial($context->owner, $context->mainMenuCode);
|
||||||
|
|
||||||
if (!$contextSidenav):
|
|
||||||
$sideMenuItems = BackendMenu::listSideMenuItems();
|
|
||||||
if ($sideMenuItems):
|
|
||||||
?>
|
?>
|
||||||
<div class="layout-cell width-120" >
|
<?php if (!$contextSidenav): ?>
|
||||||
|
<?php
|
||||||
|
$sideMenuItems = BackendMenu::listSideMenuItems();
|
||||||
|
?>
|
||||||
|
<?php if ($sideMenuItems): ?>
|
||||||
|
<div class="layout-cell width-120">
|
||||||
<div class="layout-relative">
|
<div class="layout-relative">
|
||||||
<nav class="layout-sidenav" id="layout-sidenav" data-control="sidenav">
|
<nav class="layout-sidenav" id="layout-sidenav" data-control="sidenav">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
<span
|
<span
|
||||||
class="counter <?= $item->counter === null ? 'empty' : null ?>"
|
class="counter <?= $item->counter === null ? 'empty' : null ?>"
|
||||||
data-menu-id="<?= e($context->mainMenuCode.'/'.$sideItemCode) ?>"
|
data-menu-id="<?= e($context->mainMenuCode.'/'.$sideItemCode) ?>"
|
||||||
|
<?php if ($item->counterLabel): ?>title="<?= e(trans($item->counterLabel)) ?>"<?php endif ?>
|
||||||
>
|
>
|
||||||
<?= e($item->counter) ?>
|
<?= e($item->counter) ?>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue