| 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 df3d392b22609d33dcfe1812bd16e8a65cf2568f..9e5f2aa6f5b7772555c95321167e71254f7b8cdb 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
|
| @@ -86,7 +86,7 @@ Polymer({
|
|
|
| this._updateTransition(false);
|
| // If we can animate, must do some prep work.
|
| - if (animated && !this.noAnimation) {
|
| + if (animated && !this.noAnimation && this._isDisplayed) {
|
| // Animation will start at the current size.
|
| var startSize = this._calcSize();
|
| // For `auto` we must calculate what is the final size for the animation.
|
| @@ -157,6 +157,19 @@ Polymer({
|
| this.notifyResize();
|
| },
|
|
|
| + /**
|
| + * Simplistic heuristic to detect if element has a parent with display: none
|
| + *
|
| + * @private
|
| + */
|
| + get _isDisplayed() {
|
| + var rect = this.getBoundingClientRect();
|
| + for (var prop in rect) {
|
| + if (rect[prop] !== 0) return true;
|
| + }
|
| + return false;
|
| + },
|
| +
|
| _calcSize: function() {
|
| return this.getBoundingClientRect()[this.dimension] + 'px';
|
| }
|
|
|