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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js

Issue 1221923003: Update bower.json for Polymer elements and add PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
1 1
2 Polymer({ 2 Polymer({
3 is: 'paper-radio-group', 3 is: 'paper-radio-group',
4 4
5 behaviors: [ 5 behaviors: [
6 Polymer.IronA11yKeysBehavior, 6 Polymer.IronA11yKeysBehavior,
7 Polymer.IronSelectableBehavior 7 Polymer.IronSelectableBehavior
8 ], 8 ],
9 9
10 hostAttributes: { 10 hostAttributes: {
11 role: 'radiogroup', 11 role: 'radiogroup',
12 tabindex: 0 12 tabindex: 0
13 }, 13 },
14 14
15 properties: { 15 properties: {
16 /** 16 /**
17 * Overriden from Polymer.IronSelectableBehavior 17 * Overriden from Polymer.IronSelectableBehavior
18 */ 18 */
19 attrForSelected: { 19 attrForSelected: {
20 type: String, 20 type: String,
21 value: 'name' 21 value: 'name'
22 }, 22 },
23 23
24 /** 24 /**
25 * Overriden from Polymer.IronSelectableBehavior 25 * Overriden from Polymer.IronSelectableBehavior
26 */ 26 */
27 selectedAttribute: { 27 selectedAttribute: {
28 type: String, 28 type: String,
29 value: 'checked' 29 value: 'checked'
30 },
31
32 /**
33 * Overriden from Polymer.IronSelectableBehavior
34 */
35 selectable: {
36 type: String,
37 value: 'paper-radio-button'
30 } 38 }
31 }, 39 },
32 40
33 keyBindings: { 41 keyBindings: {
34 'left up': 'selectPrevious', 42 'left up': 'selectPrevious',
35 'right down': 'selectNext', 43 'right down': 'selectNext',
36 }, 44 },
37 45
38 /** 46 /**
39 * Selects the given value. 47 * Selects the given value.
(...skipping 26 matching lines...) Expand all
66 74
67 do { 75 do {
68 newIndex = (newIndex - 1 + length) % length; 76 newIndex = (newIndex - 1 + length) % length;
69 } while (this.items[newIndex].disabled) 77 } while (this.items[newIndex].disabled)
70 78
71 this.select(this._indexToValue(newIndex)); 79 this.select(this._indexToValue(newIndex));
72 }, 80 },
73 81
74 /** 82 /**
75 * Selects the next item. If the next item is disabled, then it is 83 * Selects the next item. If the next item is disabled, then it is
76 * skipped, and its nexy item is selected 84 * skipped, and the next item after it is selected.
77 */ 85 */
78 selectNext: function() { 86 selectNext: function() {
79 var length = this.items.length; 87 var length = this.items.length;
80 var newIndex = Number(this._valueToIndex(this.selected)); 88 var newIndex = Number(this._valueToIndex(this.selected));
81 89
82 do { 90 do {
83 newIndex = (newIndex + 1 + length) % length; 91 newIndex = (newIndex + 1 + length) % length;
84 } while (this.items[newIndex].disabled) 92 } while (this.items[newIndex].disabled)
85 93
86 this.select(this._indexToValue(newIndex)); 94 this.select(this._indexToValue(newIndex));
87 }, 95 },
88 }); 96 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698