| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-section' shows a paper material themed section with a header | 7 * 'settings-section' shows a paper material themed section with a header |
| 8 * which shows its page title. | 8 * which shows its page title. |
| 9 * | 9 * |
| 10 * The section can expand vertically to fill its container's padding edge. | 10 * The section can expand vertically to fill its container's padding edge. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 animation.finished.then(function() { | 132 animation.finished.then(function() { |
| 133 this.classList.add('expanded'); | 133 this.classList.add('expanded'); |
| 134 }.bind(this), function() {}).then(function() { | 134 }.bind(this), function() {}).then(function() { |
| 135 // Unset these changes whether the animation finished or canceled. | 135 // Unset these changes whether the animation finished or canceled. |
| 136 this.classList.remove('expanding'); | 136 this.classList.remove('expanding'); |
| 137 this.style.height = ''; | 137 this.style.height = ''; |
| 138 }.bind(this)); | 138 }.bind(this)); |
| 139 return animation; | 139 return animation; |
| 140 }, | 140 }, |
| 141 | 141 |
| 142 /** @return {boolean} True if the section is currently expanded. */ | 142 /** |
| 143 * @return {boolean} True if the section is currently expanded and we know |
| 144 * what the collapsed height should be. |
| 145 */ |
| 143 canAnimateCollapse: function() { | 146 canAnimateCollapse: function() { |
| 144 return this.classList.contains('expanded') && this.clientHeight > 0 && | 147 return this.classList.contains('expanded') && this.clientHeight > 0 && |
| 145 !Number.isNaN(this.collapsedHeight_); | 148 !Number.isNaN(this.collapsedHeight_); |
| 146 }, | 149 }, |
| 147 | 150 |
| 148 /** | 151 /** |
| 149 * Prepares for the animation before the other sections become visible. | 152 * Prepares for the animation before the other sections become visible. |
| 150 * Call before animateCollapse(). | 153 * Call before animateCollapse(). |
| 151 * @param {!HTMLElement} container | 154 * @param {!HTMLElement} container |
| 152 */ | 155 */ |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 246 |
| 244 var options = /** @type {!KeyframeEffectOptions} */({ | 247 var options = /** @type {!KeyframeEffectOptions} */({ |
| 245 duration: settings.animation.Timing.DURATION, | 248 duration: settings.animation.Timing.DURATION, |
| 246 easing: settings.animation.Timing.EASING, | 249 easing: settings.animation.Timing.EASING, |
| 247 }); | 250 }); |
| 248 | 251 |
| 249 return new settings.animation.Animation( | 252 return new settings.animation.Animation( |
| 250 this.$.card, [startFrame, endFrame], options); | 253 this.$.card, [startFrame, endFrame], options); |
| 251 }, | 254 }, |
| 252 }); | 255 }); |
| OLD | NEW |