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

Side by Side Diff: third_party/polymer/v0_8/components-chromium/paper-radio-button/paper-radio-button-extracted.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 6 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 Polymer({
3 is: 'paper-radio-button',
4
5 behaviors: [
6 Polymer.PaperRadioButtonBehavior
7 ],
8
9 hostAttributes: {
10 role: 'radio',
11 'aria-checked': false,
12 tabindex: 0
13 },
14
15 properties: {
16 /**
17 * Fired when the checked state changes due to user interaction.
18 *
19 * @event change
20 */
21
22 /**
23 * Fired when the checked state changes.
24 *
25 * @event iron-change
26 */
27
28 /**
29 * Gets or sets the state, `true` is checked and `false` is unchecked.
30 */
31 checked: {
32 type: Boolean,
33 value: false,
34 reflectToAttribute: true,
35 notify: true,
36 observer: '_checkedChanged'
37 },
38
39 /**
40 * If true, the button toggles the active state with each tap or press
41 * of the spacebar.
42 */
43 toggles: {
44 type: Boolean,
45 value: true,
46 reflectToAttribute: true
47 }
48 },
49
50 ready: function() {
51 if (Polymer.dom(this).textContent == '') {
52 this.$.radioLabel.hidden = true;
53 } else {
54 this.setAttribute('aria-label', Polymer.dom(this).textContent);
55 }
56 this._isReady = true;
57 },
58
59 _buttonStateChanged: function() {
60 if (this.disabled) {
61 return;
62 }
63 if (this._isReady) {
64 this.checked = this.active;
65 }
66 },
67
68 _checkedChanged: function() {
69 this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
70 this.active = this.checked;
71 this.fire('iron-change');
72 }
73 })
74
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698