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

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

Issue 2526053002: MD Settings: roll paper-radio-button, 1.2.1 -> 1.3.1 (Closed)
Patch Set: Roll to 1.3.1 Created 4 years, 1 month 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-radio-button/paper-radio-button-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js
index 7e5559f2caa4418fb126151de0d0b166f6054a81..6816a332a3d612b1fd748a4d63ce3dfe87725750 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js
@@ -32,5 +32,23 @@ Polymer({
ready: function() {
this._rippleContainer = this.$.radioContainer;
- }
+ },
+
+ attached: function() {
+ var inkSize = this.getComputedStyleValue('--calculated-paper-radio-button-ink-size').trim();
+ // If unset, compute and set the default `--paper-radio-button-ink-size`.
+ if (inkSize === '-1px') {
+ var size = parseFloat(this.getComputedStyleValue('--calculated-paper-radio-button-size').trim());
+ var defaultInkSize = Math.floor(3 * size);
+
+ // The button and ripple need to have the same parity so that their
+ // centers align.
+ if (defaultInkSize % 2 !== size % 2) {
+ defaultInkSize++;
+ }
+
+ this.customStyle['--paper-radio-button-ink-size'] = defaultInkSize + 'px';
+ this.updateStyles();
+ }
+ },
});

Powered by Google App Engine
This is Rietveld 408576698