File tree Expand file tree Collapse file tree 7 files changed +70
-9
lines changed
src/demo-app/a11y/sidenav Expand file tree Collapse file tree 7 files changed +70
-9
lines changed Original file line number Diff line number Diff line change 2
2
< button md-icon-button aria-label ="Navigation menu " (click) ="snav.toggle() ">
3
3
< md-icon aria-hidden ="true "> menu</ md-icon >
4
4
</ button >
5
- < span class ="a11y-demo-sidenav-app-name "> Basic Sidenav App</ span >
5
+ < h1 class ="a11y-demo-sidenav-app-name "> Basic Sidenav App</ h1 >
6
6
</ md-toolbar >
7
7
8
8
< md-sidenav-container class ="a11y-demo-sidenav-container ">
9
- < md-sidenav #snav mode ="side ">
9
+ < md-sidenav #snav mode ="side " role =" navigation " >
10
10
< md-nav-list >
11
11
< a md-list-item routerLink =".. "> Home</ a >
12
12
< a md-list-item routerLink ="../basic "> Basic sidenav example</ a >
15
15
</ md-nav-list >
16
16
</ md-sidenav >
17
17
18
- < md-sidenav-content >
18
+ < md-sidenav-content role =" region " >
19
19
< button md-raised-button aria-label ="Close basic sidenav example " color ="primary "
20
20
class ="a11y-demo-sidenav-close " routerLink =".. ">
21
21
Close example
Original file line number Diff line number Diff line change
1
+ < md-toolbar color ="primary " role ="header " aria-label ="Dual sidenav app ">
2
+ < button md-icon-button aria-label ="Navigation menu " (click) ="startSnav.toggle() ">
3
+ < md-icon aria-hidden ="true "> menu</ md-icon >
4
+ </ button >
5
+ < h1 class ="a11y-demo-sidenav-app-name "> Dual Sidenav App</ h1 >
6
+ < span class ="a11y-demo-sidenav-spacer " aria-hidden ="true "> </ span >
7
+ < button md-icon-button aria-label ="Playlist menu " (click) ="endSnav.toggle() ">
8
+ < md-icon aria-hidden ="true "> playlist_play</ md-icon >
9
+ </ button >
10
+ </ md-toolbar >
11
+
12
+ < md-sidenav-container class ="a11y-demo-sidenav-container ">
13
+ < md-sidenav #startSnav mode ="side " role ="navigation ">
14
+ < md-nav-list >
15
+ < a md-list-item routerLink =".. "> Home</ a >
16
+ < a md-list-item routerLink ="../basic "> Basic sidenav example</ a >
17
+ < a md-list-item routerLink ="../mobile "> Responsive sidenav example</ a >
18
+ < a md-list-item routerLink ="../dual "> Dual sidenavs example</ a >
19
+ </ md-nav-list >
20
+ </ md-sidenav >
21
+
22
+ < md-sidenav-content role ="region ">
23
+ < button md-raised-button aria-label ="Close dual sidenav example " color ="primary "
24
+ class ="a11y-demo-sidenav-close " routerLink =".. ">
25
+ Close example
26
+ </ button >
27
+ </ md-sidenav-content >
28
+
29
+ < md-sidenav #endSnav mode ="side " position ="end " class ="a11y-demo-sidenav-playlist " role ="region ">
30
+ < h2 class ="a11y-demo-sidenav-playlist-header "> Playlists</ h2 >
31
+ < button md-button aria-label ="Thumbs up playlist " (click) ="play('Thumbs up') ">
32
+ Thumbs up
33
+ </ button >
34
+ < button md-button aria-label ="Last added playlist " (click) ="play('Last added') ">
35
+ Last added
36
+ </ button >
37
+ < button md-button aria-label ="Free and purchased playlist " (click) ="play('Free and purchased') ">
38
+ Free and purchased
39
+ </ button >
40
+ </ md-sidenav >
41
+ </ md-sidenav-container >
Original file line number Diff line number Diff line change
1
+ .a11y-demo-sidenav-spacer {
2
+ flex : 1 ;
3
+ }
4
+
5
+ md-sidenav .a11y-demo-sidenav-playlist {
6
+ display : flex ;
7
+ flex-direction : column ;
8
+ width : 200px ;
9
+ }
10
+
11
+ .a11y-demo-sidenav-playlist-header {
12
+ text-align : center ;
13
+ }
Original file line number Diff line number Diff line change 1
1
import { Component , ViewEncapsulation } from '@angular/core' ;
2
+ import { MdSnackBar } from '@angular/material' ;
2
3
3
4
4
5
@Component ( {
5
6
moduleId : module . id ,
6
7
selector : 'dual-sidenav-a11y' ,
7
8
templateUrl : 'dual-sidenav-a11y.html' ,
8
- styleUrls : [ 'shared.css' ] ,
9
+ styleUrls : [ 'shared.css' , 'dual-sidenav-a11y.css' ] ,
9
10
host : { 'class' : 'a11y-demo-sidenav-app' } ,
10
11
encapsulation : ViewEncapsulation . None ,
11
12
} )
12
- export class SidenavDualAccessibilityDemo { }
13
+ export class SidenavDualAccessibilityDemo {
14
+ constructor ( private _snackbar : MdSnackBar ) { }
15
+
16
+ play ( list : string ) {
17
+ this . _snackbar . open ( `Playing "${ list } "` , '' , { duration : 1000 } ) ;
18
+ }
19
+ }
Original file line number Diff line number Diff line change 3
3
< button md-icon-button aria-label ="Navigation menu " (click) ="snav.toggle() ">
4
4
< md-icon aria-hidden ="true "> menu</ md-icon >
5
5
</ button >
6
- < span class ="a11y-demo-sidenav-app-name "> Responsive Sidenav App</ span >
6
+ < h1 class ="a11y-demo-sidenav-app-name "> Responsive Sidenav App</ h1 >
7
7
</ md-toolbar >
8
8
9
9
< md-sidenav-container
10
10
class ="a11y-demo-sidenav-container "
11
11
[style.marginTop.px] ="mobileQuery.matches ? 56 : 0 ">
12
12
< md-sidenav
13
13
#snav
14
+ role ="navigation "
14
15
[mode] ="mobileQuery.matches ? 'over' : 'side' "
15
16
[fixedInViewport] ="mobileQuery.matches ">
16
17
< md-nav-list >
21
22
</ md-nav-list >
22
23
</ md-sidenav >
23
24
24
- < md-sidenav-content >
25
+ < md-sidenav-content role =" region " >
25
26
< button md-raised-button aria-label ="Close responsive sidenav example " color ="primary "
26
27
class ="a11y-demo-sidenav-close " routerLink =".. ">
27
28
Close example
Original file line number Diff line number Diff line change 12
12
flex : 1 ;
13
13
}
14
14
15
- .a11y-demo-sidenav-app-name {
15
+ h1 .a11y-demo-sidenav-app-name {
16
16
margin-left : 8px ;
17
17
}
18
18
Original file line number Diff line number Diff line change @@ -18,4 +18,3 @@ <h2>Dual sidenavs (e.g. music app with hamburger menu and playlist sidenav)</h2>
18
18
View example
19
19
</ a >
20
20
</ section >
21
-
You can’t perform that action at this time.
0 commit comments