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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v0_8/components-chromium/paper-radio-button/paper-radio-button-extracted.js
diff --git a/third_party/polymer/v0_8/components-chromium/paper-radio-button/paper-radio-button-extracted.js b/third_party/polymer/v0_8/components-chromium/paper-radio-button/paper-radio-button-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..81b0561a24f6a36fd4c6a48c99f06d57c554be97
--- /dev/null
+++ b/third_party/polymer/v0_8/components-chromium/paper-radio-button/paper-radio-button-extracted.js
@@ -0,0 +1,74 @@
+
+ Polymer({
+ is: 'paper-radio-button',
+
+ behaviors: [
+ Polymer.PaperRadioButtonBehavior
+ ],
+
+ hostAttributes: {
+ role: 'radio',
+ 'aria-checked': false,
+ tabindex: 0
+ },
+
+ properties: {
+ /**
+ * Fired when the checked state changes due to user interaction.
+ *
+ * @event change
+ */
+
+ /**
+ * Fired when the checked state changes.
+ *
+ * @event iron-change
+ */
+
+ /**
+ * Gets or sets the state, `true` is checked and `false` is unchecked.
+ */
+ checked: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true,
+ notify: true,
+ observer: '_checkedChanged'
+ },
+
+ /**
+ * If true, the button toggles the active state with each tap or press
+ * of the spacebar.
+ */
+ toggles: {
+ type: Boolean,
+ value: true,
+ reflectToAttribute: true
+ }
+ },
+
+ ready: function() {
+ if (Polymer.dom(this).textContent == '') {
+ this.$.radioLabel.hidden = true;
+ } else {
+ this.setAttribute('aria-label', Polymer.dom(this).textContent);
+ }
+ this._isReady = true;
+ },
+
+ _buttonStateChanged: function() {
+ if (this.disabled) {
+ return;
+ }
+ if (this._isReady) {
+ this.checked = this.active;
+ }
+ },
+
+ _checkedChanged: function() {
+ this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
+ this.active = this.checked;
+ this.fire('iron-change');
+ }
+ })
+

Powered by Google App Engine
This is Rietveld 408576698