* @param {function():!Promise} callback * @return {!Promise} * @private
(callback)
| 11247 | * @private |
| 11248 | */ |
| 11249 | animate_(callback) { |
| 11250 | const wait = this.animating_ || Promise.resolve(); |
| 11251 | return (this.animating_ = wait |
| 11252 | .then( |
| 11253 | () => { |
| 11254 | return callback(); |
| 11255 | }, |
| 11256 | () => { |
| 11257 | // Ignore errors to make sure animations don't get stuck. |
| 11258 | } |
| 11259 | ) |
| 11260 | .then(() => { |
| 11261 | this.animating_ = null; |
| 11262 | })); |
| 11263 | } |
| 11264 | |
| 11265 | /** |
| 11266 | * Returns maximum allowed height for current viewport. |