Skip to content

Commit 2167c1d

Browse files
author
Amineta Lo
committed
fix(pfVerticalNav): added badges in secondary/tertiary menu
1 parent 919418a commit 2167c1d

File tree

2 files changed

+92
-13
lines changed

2 files changed

+92
-13
lines changed

src/navigation/examples/vertical-navigation-basic.js

Lines changed: 91 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,14 @@
216216
children: [
217217
{
218218
title: "Novum",
219-
href: "#/ipsum/patrioque/novum"
219+
href: "#/ipsum/patrioque/novum",
220+
badges: [
221+
{
222+
count: 6,
223+
tooltip: "Total number of error items",
224+
badgeClass: 'example-error-background'
225+
}
226+
]
220227
},
221228
{
222229
title: "Pericula",
@@ -255,15 +262,35 @@
255262
children: [
256263
{
257264
title: "Delicatissimi",
258-
href: "#/amet/detracto/delicatissimi"
265+
href: "#/amet/detracto/delicatissimi",
266+
badges: [
267+
{
268+
count: 6,
269+
tooltip: "Total number of error items",
270+
badgeClass: 'example-error-background'
271+
}
272+
]
259273
},
260274
{
261275
title: "Aliquam",
262-
href: "#/amet/detracto/aliquam"
276+
href: "#/amet/detracto/aliquam",
277+
badges: [
278+
{
279+
count: 2,
280+
tooltip: "Total number of items"
281+
}
282+
]
263283
},
264284
{
265285
title: "Principes",
266-
href: "#/amet/detracto/principes"
286+
href: "#/amet/detracto/principes",
287+
badges: [
288+
{
289+
count: 18,
290+
tooltip: "Total number of warning items",
291+
badgeClass: 'example-warning-background'
292+
}
293+
]
267294
}
268295
]
269296
},
@@ -272,15 +299,35 @@
272299
children: [
273300
{
274301
title: "Convenire",
275-
href: "#/amet/mediocrem/convenire"
302+
href: "#/amet/mediocrem/convenire",
303+
badges: [
304+
{
305+
count: 6,
306+
tooltip: "Total number of error items",
307+
badgeClass: 'example-error-background'
308+
}
309+
]
276310
},
277311
{
278312
title: "Nonumy",
279-
href: "#/amet/mediocrem/nonumy"
313+
href: "#/amet/mediocrem/nonumy",
314+
badges: [
315+
{
316+
count: 2,
317+
tooltip: "Total number of items"
318+
}
319+
]
280320
},
281321
{
282322
title: "Deserunt",
283-
href: "#/amet/mediocrem/deserunt"
323+
href: "#/amet/mediocrem/deserunt",
324+
badges: [
325+
{
326+
count: 18,
327+
tooltip: "Total number of warning items",
328+
badgeClass: 'example-warning-background'
329+
}
330+
]
284331
}
285332
]
286333
},
@@ -289,21 +336,53 @@
289336
children: [
290337
{
291338
title: "Aeque",
292-
href: "#/amet/corrumpit/aeque"
339+
href: "#/amet/corrumpit/aeque",
340+
badges: [
341+
{
342+
count: 6,
343+
tooltip: "Total number of error items",
344+
badgeClass: 'example-error-background'
345+
}
346+
]
293347
},
294348
{
295349
title: "Delenit",
296-
href: "#/amet/corrumpit/delenit"
350+
href: "#/amet/corrumpit/delenit",
351+
badges: [
352+
{
353+
count: 2,
354+
tooltip: "Total number of items"
355+
}
356+
]
297357
},
298358
{
299359
title: "Qualisque",
300-
href: "#/amet/corrumpit/qualisque"
360+
href: "#/amet/corrumpit/qualisque",
361+
badges: [
362+
{
363+
count: 18,
364+
tooltip: "Total number of warning items",
365+
badgeClass: 'example-warning-background'
366+
}
367+
]
301368
}
302369
]
303370
},
304371
{
305-
title: "urbanitas",
306-
href: "#/amet/urbanitas"
372+
title: "Urbanitas",
373+
href: "#/amet/urbanitas",
374+
badges: [
375+
{
376+
count: 2,
377+
tooltip: "Total number of error items",
378+
iconClass: 'pficon pficon-error-circle-o'
379+
},
380+
{
381+
count: 6,
382+
tooltip: "Total number warning error items",
383+
iconClass: 'pficon pficon-warning-triangle-o'
384+
}
385+
]
307386
}
308387
]
309388
},

src/navigation/vertical-navigation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
ng-mouseenter="$ctrl.handleSecondaryHover(secondaryItem)" ng-mouseleave="$ctrl.handleSecondaryUnHover(secondaryItem)">
7171
<a ng-click="$ctrl.handleSecondaryClick(item, secondaryItem, $event)">
7272
<span class="list-group-item-value">{{secondaryItem.title}}</span>
73-
<div ng-if="showBadges && secondaryItem.badges" class="badge-container-pf">
73+
<div ng-if="$ctrl.showBadges && secondaryItem.badges" class="badge-container-pf">
7474
<div class="badge {{badge.badgeClass}}" ng-repeat="badge in secondaryItem.badges"
7575
uib-tooltip="{{badge.tooltip}}"
7676
tooltip-append-to-body="true"

0 commit comments

Comments
 (0)