This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a1ba65
commit 5d1ce24
Showing
6 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<div layout="column" style="height:500px;"> | ||
|
||
<md-sidenav-container layout="row" flex> | ||
|
||
<md-sidenav name="left" [style]="hasMedia('gt-sm') ? 'side' : 'over'"> | ||
|
||
<md-toolbar class="md-theme-indigo"> | ||
<h1 class="md-toolbar-tools">Sidenav Left</h1> | ||
</md-toolbar> | ||
<md-content layout-padding> | ||
<button md-raised-button (click)="close('left')" class="md-primary" hide-gt-md> | ||
Close Sidenav Left | ||
</button> | ||
<p hide-md show-gt-md> | ||
This sidenav is locked open on your device. To go back to the default behavior, | ||
narrow your display. | ||
</p> | ||
</md-content> | ||
|
||
</md-sidenav> | ||
|
||
<md-content flex layout-padding> | ||
|
||
<div layout="column" layout-fill layout-align="top center"> | ||
<p> | ||
The left sidenav will 'lock open' on a medium (>=960px wide) device. | ||
</p> | ||
<p> | ||
The right sidenav will focus on a specific child element. | ||
</p> | ||
|
||
<div> | ||
<button md-raised-button (click)="open('left')" | ||
class="md-primary" hide-gt-md> | ||
Toggle left | ||
</button> | ||
</div> | ||
|
||
<div> | ||
<button md-raised-button (click)="open('right')" | ||
[hidden]="rightOpened" | ||
class="md-primary"> | ||
Toggle right | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div flex></div> | ||
|
||
</md-content> | ||
|
||
<md-sidenav name="right" align="right" layout="column"> | ||
<md-toolbar class="md-theme-light"> | ||
<h1 class="md-toolbar-tools">Sidenav Right</h1> | ||
</md-toolbar> | ||
<md-content layout-padding> | ||
<form> | ||
<md-input-container class="md-block"> | ||
<label for="testInput">Test input</label> | ||
<input type="text" id="testInput" md-input | ||
[(value)]="data" md-autofocus> | ||
</md-input-container> | ||
</form> | ||
<button md-raised-button (click)="close('right')" class="md-primary"> | ||
Close Sidenav Right | ||
</button> | ||
</md-content> | ||
|
||
</md-sidenav> | ||
|
||
</md-sidenav-container> | ||
|
||
</div> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {View, Component} from 'angular2/core'; | ||
import {MATERIAL_DIRECTIVES, Media, SidenavService} from 'ng2-material/all'; | ||
|
||
|
||
|
||
@Component({selector: 'sidenav-basic-usage'}) | ||
@View({ | ||
templateUrl: 'examples/components/sidenav/basic_usage.html', | ||
styleUrls: ['examples/components/sidenav/basic_usage.css'], | ||
directives: [MATERIAL_DIRECTIVES] | ||
}) | ||
export default class SidenavBasicUsage { | ||
|
||
constructor(public sidenav:SidenavService) { | ||
|
||
} | ||
|
||
hasMedia(breakSize:string):boolean { | ||
return Media.hasMedia(breakSize); | ||
} | ||
|
||
open(name:string) { | ||
this.sidenav.show(name); | ||
} | ||
close(name:string) { | ||
this.sidenav.hide(name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters