Skip to content

Commit

Permalink
feat(navlist): syntactic sugar for simple nav lists
Browse files Browse the repository at this point in the history
  • Loading branch information
kara committed Apr 19, 2016
1 parent e7611ce commit c21c336
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ md-list, md-nav-list {
}


md-list-item {
md-list-item, a[md-list-item] {
@include md-list-item-base(
$md-list-font-size,
$md-list-base-height,
Expand All @@ -164,7 +164,7 @@ md-list[dense], md-nav-list[dense] {
);
}

md-list-item {
md-list-item, a[md-list-item] {
@include md-list-item-base(
$md-dense-font-size,
$md-dense-base-height,
Expand Down
2 changes: 1 addition & 1 deletion src/components/list/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class MdLine {}
export class MdListAvatar {}

@Component({
selector: 'md-list-item',
selector: 'md-list-item, a[md-list-item]',
host: {'role': 'listitem'},
templateUrl: './components/list/list-item.html',
encapsulation: ViewEncapsulation.None
Expand Down
28 changes: 14 additions & 14 deletions src/demo-app/demo-app.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<md-sidenav-layout>
<md-sidenav #start>
<md-nav-list>
<md-list-item><a md-line [routerLink]="['ButtonDemo']">Button</a></md-list-item>
<md-list-item><a md-line [routerLink]="['CardDemo']">Card</a></md-list-item>
<md-list-item><a md-line [routerLink]="['ProgressCircleDemo']">Progress Circle</a></md-list-item>
<md-list-item><a md-line [routerLink]="['ProgressBarDemo']">Progress Bar</a></md-list-item>
<md-list-item><a md-line [routerLink]="['PortalDemo']">Portal</a></md-list-item>
<md-list-item><a md-line [routerLink]="['OverlayDemo']">Overlay</a></md-list-item>
<md-list-item><a md-line [routerLink]="['CheckboxDemo']">Checkbox</a></md-list-item>
<md-list-item><a md-line [routerLink]="['InputDemo']">Input</a></md-list-item>
<md-list-item><a md-line [routerLink]="['ToolbarDemo']">Toolbar</a></md-list-item>
<md-list-item><a md-line [routerLink]="['RadioDemo']">Radio</a></md-list-item>
<md-list-item><a md-line [routerLink]="['ListDemo']">List</a></md-list-item>
<md-list-item><a md-line [routerLink]="['LiveAnnouncerDemo']">Live Announcer</a></md-list-item>
<md-list-item><a md-line [routerLink]="['SidenavDemo']">Sidenav</a></md-list-item>
<md-list-item><a md-line [routerLink]="['GesturesDemo']">Gestures</a></md-list-item>
<a md-list-item [routerLink]="['ButtonDemo']">Button</a>
<a md-list-item [routerLink]="['CardDemo']">Card</a>
<a md-list-item [routerLink]="['ProgressCircleDemo']">Progress Circle</a>
<a md-list-item [routerLink]="['ProgressBarDemo']">Progress Bar</a>
<a md-list-item [routerLink]="['PortalDemo']">Portal</a>
<a md-list-item [routerLink]="['OverlayDemo']">Overlay</a>
<a md-list-item [routerLink]="['CheckboxDemo']">Checkbox</a>
<a md-list-item [routerLink]="['InputDemo']">Input</a>
<a md-list-item [routerLink]="['ToolbarDemo']">Toolbar</a>
<a md-list-item [routerLink]="['RadioDemo']">Radio</a>
<a md-list-item [routerLink]="['ListDemo']">List</a>
<a md-list-item [routerLink]="['LiveAnnouncerDemo']">Live Announcer</a>
<a md-list-item [routerLink]="['SidenavDemo']">Sidenav</a>
<a md-list-item [routerLink]="['GesturesDemo']">Gestures</a>
</md-nav-list>
<button md-raised-button (click)="start.close()">CLOSE</button>
</md-sidenav>
Expand Down
10 changes: 10 additions & 0 deletions src/demo-app/list/list-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ <h4 md-line>{{message.from}}</h4>
</button>
</md-list-item>
</md-nav-list>
<md-nav-list>
<a md-list-item *ngFor="#link of links" href="http://www.google.com">
{{ link.name }}
</a>
</md-nav-list>
</div>

<div>
Expand Down Expand Up @@ -85,5 +90,10 @@ <h4 md-line>{{message.from}}</h4>
</button>
</md-list-item>
</md-nav-list>
<md-nav-list dense>
<a md-list-item *ngFor="#link of links" href="http://www.google.com">
{{ link.name }}
</a>
</md-nav-list>
</div>
</div>

0 comments on commit c21c336

Please sign in to comment.