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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-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/iron-collapse/iron-collapse-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js
index 4ac7a797fcfb1f145f79ef900aea2fe859fd0a2c..f0ee2425b047f6c01f5b51b4624ed2e600ff1afd 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js
@@ -1,6 +1,4 @@
-
-
- Polymer({
+Polymer({
is: 'iron-collapse',
@@ -56,21 +54,11 @@
},
show: function() {
- this.toggleClass('iron-collapse-closed', false);
- this.updateSize('auto', false);
- var s = this._calcSize();
- this.updateSize('0px', false);
- // force layout to ensure transition will go
- this.offsetHeight;
- this.updateSize(s, true);
+ this.opened = true;
},
hide: function() {
- this.toggleClass('iron-collapse-opened', false);
- this.updateSize(this._calcSize(), false);
- // force layout to ensure transition will go
- this.offsetHeight;
- this.updateSize('0px', true);
+ this.opened = false;
},
updateSize: function(size, animated) {
@@ -93,7 +81,22 @@
},
_openedChanged: function() {
- this[this.opened ? 'show' : 'hide']();
+ if (this.opened) {
+ this.toggleClass('iron-collapse-closed', false);
+ this.updateSize('auto', false);
+ var s = this._calcSize();
+ this.updateSize('0px', false);
+ // force layout to ensure transition will go
+ /** @suppress {suspiciousCode} */ this.offsetHeight;
+ this.updateSize(s, true);
+ }
+ else {
+ this.toggleClass('iron-collapse-opened', false);
+ this.updateSize(this._calcSize(), false);
+ // force layout to ensure transition will go
+ /** @suppress {suspiciousCode} */ this.offsetHeight;
+ this.updateSize('0px', true);
+ }
this.setAttribute('aria-expanded', this.opened ? 'true' : 'false');
},
@@ -112,5 +115,4 @@
},
- });
-
+ });

Powered by Google App Engine
This is Rietveld 408576698