Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: third_party/polymer/components/paper-radio-group/paper-radio-group.html

Issue 1215543002: Remove Polymer 0.5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
8 -->
9
10 <!--
11 `paper-radio-group` allows user to select only one radio button from a set.
12 Checking one radio button that belongs to a radio group unchecks any
13 previously checked radio button within the same group. Use
14 `selected` to get or set the selected radio button.
15
16 Example:
17
18 <paper-radio-group selected="small">
19 <paper-radio-button name="small" label="Small"></paper-radio-button>
20 <paper-radio-button name="medium" label="Medium"></paper-radio-button>
21 <paper-radio-button name="large" label="Large"></paper-radio-button>
22 </paper-radio-group>
23
24 See <a href="../paper-radio-button/">paper-radio-button</a> for more
25 information about `paper-radio-button`.
26
27 @group Paper Elements
28 @element paper-radio-group
29 @extends core-selector
30 @homepage github.io
31 -->
32
33 <link rel="import" href="../core-a11y-keys/core-a11y-keys.html">
34 <link rel="import" href="../core-selector/core-selector.html">
35 <link rel="import" href="../paper-radio-button/paper-radio-button.html">
36
37 <polymer-element name="paper-radio-group" extends="core-selector" role="radiogro up">
38
39 <template>
40
41 <core-a11y-keys target="{{}}" keys="up left" on-keys-pressed="{{selectPrevio us}}"></core-a11y-keys>
42 <core-a11y-keys target="{{}}" keys="down right" on-keys-pressed="{{selectNex t}}"></core-a11y-keys>
43
44 <style>
45
46 :host {
47 display: inline-block;
48 }
49
50 polyfill-next-selector { content: ':host > *'; }
51 ::content > * {
52 padding: 12px;
53 }
54
55 </style>
56
57 <shadow></shadow>
58
59 </template>
60
61 <script>
62
63 Polymer('paper-radio-group', {
64 nextIndex: function(index) {
65 var items = this.items;
66 var newIndex = index;
67 do {
68 newIndex = (newIndex + 1) % items.length;
69 if (newIndex === index) {
70 break;
71 }
72 } while (items[newIndex].disabled);
73 return newIndex;
74 },
75 previousIndex: function(index) {
76 var items = this.items;
77 var newIndex = index;
78 do {
79 newIndex = (newIndex || items.length) - 1;
80 if (newIndex === index) {
81 break;
82 }
83 } while (items[newIndex].disabled);
84 return newIndex;
85 },
86 selectNext: function() {
87 var node = this.selectIndex(this.nextIndex(this.selectedIndex));
88 node.focus();
89 },
90 selectPrevious: function() {
91 var node = this.selectIndex(this.previousIndex(this.selectedIndex));
92 node.focus();
93 },
94 selectedAttribute: 'checked',
95 activateEvent: 'change'
96
97 });
98
99 </script>
100
101 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698