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

Unified Diff: third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 years, 3 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/components-chromium/paper-radio-button/paper-radio-button-extracted.js
diff --git a/third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js b/third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..2e066ed5ee57215828c9d48c6270d16cb32c0d17
--- /dev/null
+++ b/third_party/polymer/components-chromium/paper-radio-button/paper-radio-button-extracted.js
@@ -0,0 +1,75 @@
+
+
+ Polymer('paper-radio-button', {
+
+ /**
+ * Fired when the checked state changes.
+ *
+ * @event change
+ */
+
+ publish: {
+ /**
+ * Gets or sets the state, `true` is checked and `false` is unchecked.
+ *
+ * @attribute checked
+ * @type boolean
+ * @default false
+ */
+ checked: {value: false, reflect: true},
+
+ /**
+ * The label for the radio button.
+ *
+ * @attribute label
+ * @type string
+ * @default ''
+ */
+ label: '',
+
+ /**
+ * Normally the user cannot uncheck the radio button by tapping once
+ * checked. Setting this property to `true` makes the radio button
+ * toggleable from checked to unchecked.
+ *
+ * @attribute toggles
+ * @type boolean
+ * @default false
+ */
+ toggles: false,
+
+ /**
+ * If true, the user cannot interact with this element.
+ *
+ * @attribute disabled
+ * @type boolean
+ * @default false
+ */
+ disabled: {value: false, reflect: true}
+ },
+
+ eventDelegates: {
+ tap: 'tap'
+ },
+
+ tap: function() {
+ this.toggle();
+ this.fire('paper-radio-button-activate');
+ },
+
+ toggle: function() {
+ this.checked = !this.toggles || !this.checked;
+ },
+
+ checkedChanged: function() {
+ this.$.onRadio.classList.toggle('fill', this.checked);
+ this.setAttribute('aria-checked', this.checked ? 'true': 'false');
+ this.fire('change');
+ },
+
+ labelChanged: function() {
+ this.setAttribute('aria-label', this.label);
+ }
+
+ });
+

Powered by Google App Engine
This is Rietveld 408576698