Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #119 from Orange-OpenSource/bugfixes/navbar
Browse files Browse the repository at this point in the history
o-nav-menu correction & its exemple in the doc
  • Loading branch information
BehnooshShiva authored Oct 16, 2019
2 parents 4adcd65 + 4bd4d4d commit debd517
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button class="nav-link" ngbDropdownToggle [attr.title]="title === 'undefined' ? null : title" [attr.aria-label]="title === 'undefined' ? null : title"
<button class="nav-link" ngbDropdownToggle [attr.title]="title === 'undefined' ? null : title" [attr.id]="idForLabelledby === 'undefined' ? null : idForLabelledby" [attr.aria-label]="title === 'undefined' ? null : title"
(click)="$event.stopPropagation();">{{menuTitle}}</button>
<ng-content></ng-content>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { Component, Input, HostBinding } from '@angular/core';

@Component({
selector: 'lib-li[o-nav-menu]',
selector: 'li[o-nav-menu]',
styles: [`
button {
border: 0;
Expand All @@ -30,4 +30,7 @@ import { Component, Input, HostBinding } from '@angular/core';

@Input()
public title: string;

@Input()
public idForLabelledby: string;
}
7 changes: 7 additions & 0 deletions src/app/demos/o-navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<li><a class="dropdown-item" href="#">About Markdown</a></li>
</ul>
</li>
<li ngbDropdown o-nav-menu idForLabelledby="dropdownMenu1" menuTitle="Toggle dropdown">
<div ngbDropdownMenu aria-labelledby="dropdownMenu1">
<button ngbDropdownItem>Action - 1</button>
<button ngbDropdownItem>Another Action</button>
<button ngbDropdownItem>Something else is here</button>
</div>
</li>

<li class="nav-item"><a href="http://orange.com" class="nav-link">External link</a></li>
</lib-o-navbar>

0 comments on commit debd517

Please sign in to comment.