Skip to content

Commit

Permalink
feat(layout): add toggle/open/close directives for layouts with siden…
Browse files Browse the repository at this point in the history
…av. (#745)

* feat(layout): add toggle/open/close directives for layouts with sidenav.

so we can open/close/toggle any sidenav from any child component, we need special directives that access their parent layouts.

with this we can affect the behavior of it, and it also includes [hideWhenOpened] input and a default input to disable/enable the action leveraging the media service

* fix(): lint errors

* update(docs): overhaul layout demos
  • Loading branch information
emoralesb05 authored Jul 7, 2017
1 parent da52d3d commit 346a4bf
Show file tree
Hide file tree
Showing 31 changed files with 2,113 additions and 901 deletions.
8 changes: 4 additions & 4 deletions src/app/components/components/components.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h3 md-subheader>Core Components</h3>
[routerLink]="[item.route]"
[routerLinkActive]="['active']"
[routerLinkActiveOptions]="{exact:true}"
(click)="!media.query('gt-sm') && navList.close()">
[tdLayoutNavListClose]="!media.query('gt-sm')">
<md-icon md-list-avatar>{{item.icon}}</md-icon>
<h3 md-line> {{item.title}} </h3>
<p md-line> {{item.description}} </p>
Expand All @@ -28,7 +28,7 @@ <h3 md-subheader>Optional Components</h3>
[routerLink]="[item.route]"
[routerLinkActive]="['active']"
[routerLinkActiveOptions]="{exact:true}"
(click)="!media.query('gt-sm') && navList.close()">
[tdLayoutNavListClose]="!media.query('gt-sm')">
<md-icon md-list-avatar>{{item.icon}}</md-icon>
<h3 md-line> {{item.title}} </h3>
<p md-line> {{item.description}} </p>
Expand All @@ -50,7 +50,7 @@ <h3 md-line> Angular Material </h3>
[routerLink]="[item.route]"
[routerLinkActive]="['active']"
[routerLinkActiveOptions]="{exact:true}"
(click)="!media.query('gt-sm') && navList.close()">
[tdLayoutNavListClose]="!media.query('gt-sm')">
<md-icon md-list-avatar>{{item.icon}}</md-icon>
<h3 md-line> {{item.title}} </h3>
<p md-line> {{item.description}} </p>
Expand All @@ -59,7 +59,7 @@ <h3 md-line> {{item.title}} </h3>
</ng-template>
</md-nav-list>
<div td-toolbar-content layout="row" layout-align="start center" flex>
<button md-icon-button tdLayoutNavListToggle>
<button md-icon-button tdLayoutNavListOpen [hideWhenOpened]="true">
<md-icon>arrow_back</md-icon>
</button>
<span hide-gt-md flex>Components &amp; Addons</span>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/docs/docs.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[routerLink]="[item.route]"
[routerLinkActive]="['active']"
[routerLinkActiveOptions]="{exact:true}"
(click)="!media.query('gt-sm') && navList.close()">
[tdLayoutNavListClose]="!media.query('gt-sm')">
<md-icon md-list-avatar>{{item.icon}}</md-icon>
<h3 md-line> {{item.title}} </h3>
<p md-line> {{item.description}} </p>
Expand All @@ -23,7 +23,7 @@ <h3 md-line> {{item.title}} </h3>
</ng-template>
</md-nav-list>
<div td-toolbar-content layout="row" layout-align="start center" flex>
<button md-icon-button tdLayoutNavListToggle>
<button md-icon-button tdLayoutNavListOpen [hideWhenOpened]="true">
<md-icon>arrow_back</md-icon>
</button>
<span hide-gt-md flex>Documentation</span>
Expand Down
Loading

0 comments on commit 346a4bf

Please sign in to comment.