Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit e3cd7b3

Browse files
authored
Merge pull request #103 from ovh-ux/feature/empty-navbar-menu
style(navbar): hide empty sublinks
2 parents 015e48b + 1145c40 commit e3cd7b3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/oui-navbar/src/index.spec.data.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@
354354
"url": "#!/oui-angular/navbar"
355355
}
356356
]
357+
},
358+
{
359+
"name": "empty",
360+
"label": "Not visible",
361+
"title": "Empty",
362+
"subLinks": []
357363
}
358364
]
359365
},

packages/oui-navbar/src/menu/navbar-menu.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
7777
<!-- Button for Next Level -->
7878
<button class="oui-navbar-link" type="button"
7979
aria-haspopup="true" aria-expanded="{{!!$ctrl.navigation[menuLink.name]}}"
80-
ng-if="::!!menuLink.subLinks"
80+
ng-if="::!!menuLink.subLinks && !!menuLink.subLinks.length"
8181
ng-attr-aria-label="{{::!!menuLink.label ? menuLink.label : null}}"
8282
ng-attr-title="{{::!!menuLink.label ? menuLink.label : null}}"
8383
ng-class="::{
@@ -92,8 +92,8 @@ <h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
9292
<!-- Button for Next Level -->
9393

9494
<!-- Menu for Next Level -->
95-
<oui-navbar-menu
96-
ng-if="::!!menuLink.subLinks"
95+
<oui-navbar-menu class="oui-navbar_mobile-only"
96+
ng-if="::!!menuLink.subLinks && !!menuLink.subLinks.length"
9797
ng-class="::!!$ctrl.childrenClass ? $ctrl.childrenClass : null"
9898
children-class="{{::$ctrl.childrenClass}}"
9999
back-button="true"

0 commit comments

Comments
 (0)