2 is
: 'paper-radio-group',
5 Polymer
.IronA11yKeysBehavior
,
6 Polymer
.IronSelectableBehavior
16 * Overriden from Polymer.IronSelectableBehavior
24 * Overriden from Polymer.IronSelectableBehavior
32 * Overriden from Polymer.IronSelectableBehavior
36 value
: 'paper-radio-button'
41 'left up': 'selectPrevious',
42 'right down': 'selectNext',
46 * Selects the given value.
48 select: function(value
) {
50 var oldItem
= this._valueToItem(this.selected
);
52 // Do not allow unchecking the selected item.
53 if (this.selected
== value
) {
54 oldItem
.checked
= true;
59 oldItem
.checked
= false;
62 Polymer
.IronSelectableBehavior
.select
.apply(this, [value
]);
63 this.fire('paper-radio-group-changed');
67 * Selects the previous item. If the previous item is disabled, then it is
68 * skipped, and its previous item is selected
70 selectPrevious: function() {
71 var length
= this.items
.length
;
72 var newIndex
= Number(this._valueToIndex(this.selected
));
75 newIndex
= (newIndex
- 1 + length
) % length
;
76 } while (this.items
[newIndex
].disabled
)
78 this.select(this._indexToValue(newIndex
));
82 * Selects the next item. If the next item is disabled, then it is
83 * skipped, and the next item after it is selected.
85 selectNext: function() {
86 var length
= this.items
.length
;
87 var newIndex
= Number(this._valueToIndex(this.selected
));
90 newIndex
= (newIndex
+ 1 + length
) % length
;
91 } while (this.items
[newIndex
].disabled
)
93 this.select(this._indexToValue(newIndex
));