This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree 3 files changed +34
-28
lines changed
3 files changed +34
-28
lines changed Original file line number Diff line number Diff line change 4
4
"dependencies" : {
5
5
"core-selector" : " Polymer/core-selector#master" ,
6
6
"core-collapse" : " Polymer/core-collapse#master" ,
7
+ "core-a11y-keys" : " Polymer/core-a11y-keys#master" ,
7
8
"core-item" : " Polymer/core-item#master"
8
9
}
9
10
}
Original file line number Diff line number Diff line change 15
15
<core-item icon="dialog" label="Dialog"></core-item>
16
16
<core-item icon="search" label="Search"></core-item>
17
17
</core-menu>
18
-
18
+
19
19
When an item is selected the `core-selected` class is added to it. The user can
20
20
use the class to add more stylings to the selected item.
21
21
56
56
-->
57
57
58
58
< link rel ="import " href ="../core-selector/core-selector.html ">
59
+ < link rel ="import " href ="../core-a11y-keys/core-a11y-keys.html ">
59
60
60
- < polymer-element name ="core-menu " extends ="core-selector " noscript >
61
+ < polymer-element name ="core-menu " extends ="core-selector " tabindex =" 0 " noscript >
61
62
< template >
62
63
63
64
< link rel ="stylesheet " href ="core-menu.css ">
64
-
65
+
66
+ < core-a11y-keys target ="{{}} " keys ="up " on-keys-pressed ="{{ selectPrevious }} "> </ core-a11y-keys >
67
+ < core-a11y-keys target ="{{}} " keys ="down " on-keys-pressed ="{{ selectNext }} "> </ core-a11y-keys >
68
+ < core-a11y-keys target ="{{}} " keys ="enter " on-keys-pressed ="{{ validateSelected }} "> </ core-a11y-keys >
69
+
65
70
< shadow > </ shadow >
66
-
71
+
67
72
</ template >
68
73
</ polymer-element >
Original file line number Diff line number Diff line change 20
20
< link rel ="import " href ="../core-item/core-item.html ">
21
21
22
22
< style >
23
-
23
+
24
24
body {
25
25
font-family : sans-serif;
26
26
margin : 20px ;
29
29
section {
30
30
width : 300px ;
31
31
}
32
-
32
+
33
33
.dark {
34
34
background-color : # 333 ;
35
35
}
45
45
< body >
46
46
47
47
< h2 > simple menu:</ h2 >
48
-
48
+
49
49
< section >
50
-
50
+
51
51
< core-menu selected ="0 ">
52
-
52
+
53
53
< core-item icon ="settings " label ="Settings "> </ core-item >
54
54
< core-item icon ="favorite " label ="Favorite "> </ core-item >
55
55
< core-item icon ="account-box " label ="Account "> </ core-item >
56
-
56
+
57
57
</ core-menu >
58
-
58
+
59
59
</ section >
60
-
60
+
61
61
< h2 > simple menu:</ h2 >
62
-
62
+
63
63
< section class ="dark ">
64
-
64
+
65
65
< core-menu selected ="0 ">
66
-
66
+
67
67
< core-item icon ="settings " label ="Settings "> </ core-item >
68
68
< core-item icon ="favorite " label ="Favorite "> </ core-item >
69
69
< core-item icon ="account-box " label ="Account "> </ core-item >
70
-
70
+
71
71
</ core-menu >
72
-
72
+
73
73
</ section >
74
74
75
75
< h2 > submenu:</ h2 >
76
-
76
+
77
77
< section >
78
-
78
+
79
79
< core-menu selected ="0 ">
80
-
80
+
81
81
< core-submenu icon ="settings " label ="Topics ">
82
-
82
+
83
83
< core-item label ="Topic 1 "> </ core-item >
84
84
< core-item label ="Topic 2 "> </ core-item >
85
-
85
+
86
86
</ core-submenu >
87
-
87
+
88
88
< core-submenu icon ="settings " label ="Favorites ">
89
-
89
+
90
90
< core-item label ="Favorite 1 "> </ core-item >
91
91
< core-item label ="Favorite 2 "> </ core-item >
92
92
< core-item label ="Favorite 3 "> </ core-item >
93
-
93
+
94
94
</ core-submenu >
95
-
95
+
96
96
</ core-menu >
97
-
97
+
98
98
</ section >
99
-
99
+
100
100
</ body >
101
101
</ html >
You can’t perform that action at this time.
0 commit comments