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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js

Issue 1287713002: [MD settings] merge polymer 1.0.11; hack for settings checkbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
index 7907d202250acd67a1bee45f8faf14b7fb8b6fe7..1c7fc9aec4d62e7a47aca4a4ef39e0681b922b0d 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
@@ -1,5 +1,4 @@
-
- Polymer({
+Polymer({
is: 'paper-checkbox',
behaviors: [
@@ -47,11 +46,14 @@
}
},
- ready: function() {
- if (Polymer.dom(this).textContent == '') {
+ attached: function() {
+ var trimmedText = Polymer.dom(this).textContent.trim();
+ if (trimmedText === '') {
this.$.checkboxLabel.hidden = true;
- } else {
- this.setAttribute('aria-label', Polymer.dom(this).textContent);
+ }
+ // Don't stomp over a user-set aria-label.
+ if (trimmedText !== '' && !this.getAttribute('aria-label')) {
+ this.setAttribute('aria-label', trimmedText);
}
this._isReady = true;
},
@@ -85,5 +87,4 @@
}
return '';
}
- })
-
+ });

Powered by Google App Engine
This is Rietveld 408576698