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

Unified Diff: third_party/polymer/v0_8/components-chromium/paper-checkbox/paper-checkbox-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-checkbox/paper-checkbox-extracted.js
diff --git a/third_party/polymer/v0_8/components-chromium/paper-checkbox/paper-checkbox-extracted.js b/third_party/polymer/v0_8/components-chromium/paper-checkbox/paper-checkbox-extracted.js
index 949b827e89ce3ccee62a50e98f73559c1c3e6161..c166e07b8d1ffab01926898eb97466b3e1371fa0 100644
--- a/third_party/polymer/v0_8/components-chromium/paper-checkbox/paper-checkbox-extracted.js
+++ b/third_party/polymer/v0_8/components-chromium/paper-checkbox/paper-checkbox-extracted.js
@@ -1,90 +1,87 @@
- Polymer({
- is: 'paper-checkbox',
+ Polymer({
+ is: 'paper-checkbox',
- // The custom properties shim is currently an opt-in feature.
- enableCustomStyleProperties: true,
+ behaviors: [
+ Polymer.PaperRadioButtonBehavior
+ ],
- behaviors: [
- Polymer.PaperRadioButtonBehavior
- ],
+ hostAttributes: {
+ role: 'checkbox',
+ 'aria-checked': false,
+ tabindex: 0
+ },
- hostAttributes: {
- role: 'checkbox',
- 'aria-checked': false,
- tabindex: 0
- },
+ properties: {
+ /**
+ * Fired when the checked state changes due to user interaction.
+ *
+ * @event change
+ */
- properties: {
- /**
- * Fired when the checked state changes due to user interaction.
- *
- * @event change
- */
+ /**
+ * Fired when the checked state changes.
+ *
+ * @event iron-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'
+ },
- /**
- * Gets or sets the state, `true` is checked and `false` is unchecked.
- *
- * @attribute checked
- * @type boolean
- * @default false
- */
- 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
+ }
},
- /**
- * If true, the user cannot interact with this element.
- *
- * @attribute disabled
- * @type boolean
- * @default false
- */
- disabled: {
- type: Boolean
- }
- },
-
- ready: function() {
- this.toggles = true;
-
- if (this.$.checkboxLabel.textContent == '') {
- this.$.checkboxLabel.hidden = true;
- } else {
- this.setAttribute('aria-label', this.$.checkboxLabel.textContent);
- }
- },
+ ready: function() {
+ if (Polymer.dom(this).textContent == '') {
+ this.$.checkboxLabel.hidden = true;
+ } else {
+ this.setAttribute('aria-label', Polymer.dom(this).textContent);
+ }
+ this._isReady = true;
+ },
- // button-behavior hook
- _buttonStateChanged: function() {
- this.checked = this.active;
- },
+ // button-behavior hook
+ _buttonStateChanged: function() {
+ if (this.disabled) {
+ return;
+ }
+ if (this._isReady) {
+ this.checked = this.active;
+ }
+ },
- _checkedChanged: function(checked) {
- this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
- this.active = this.checked;
- this.fire('iron-change');
- },
+ _checkedChanged: function(checked) {
+ this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
+ this.active = this.checked;
+ this.fire('iron-change');
+ },
- _computeCheckboxClass: function(checked) {
- if (checked) {
- return 'checked';
- }
- },
+ _computeCheckboxClass: function(checked) {
+ if (checked) {
+ return 'checked';
+ }
+ },
- _computeCheckmarkClass: function(checked) {
- if (!checked) {
- return 'hidden';
+ _computeCheckmarkClass: function(checked) {
+ if (!checked) {
+ return 'hidden';
+ }
}
- }
- })
+ })
+

Powered by Google App Engine
This is Rietveld 408576698