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 @@ |
}, |
- }); |
- |
+ }); |