| OLD | NEW |
| 1 // IIFE to help scripts concatenation. | 1 // IIFE to help scripts concatenation. |
| 2 (function() { | 2 (function() { |
| 3 'use strict'; | 3 'use strict'; |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or
shown, and displays | 6 Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or
shown, and displays |
| 7 on top of other content. It includes an optional backdrop, and can be used to im
plement a variety | 7 on top of other content. It includes an optional backdrop, and can be used to im
plement a variety |
| 8 of UI controls including dialogs and drop downs. Multiple overlays may be displa
yed at once. | 8 of UI controls including dialogs and drop downs. Multiple overlays may be displa
yed at once. |
| 9 | 9 |
| 10 ### Closing and canceling | 10 ### Closing and canceling |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (!this._overlaySetup) { | 302 if (!this._overlaySetup) { |
| 303 return; | 303 return; |
| 304 } | 304 } |
| 305 | 305 |
| 306 this._manager.addOrRemoveOverlay(this); | 306 this._manager.addOrRemoveOverlay(this); |
| 307 | 307 |
| 308 this.__isAnimating = true; | 308 this.__isAnimating = true; |
| 309 | 309 |
| 310 // requestAnimationFrame for non-blocking rendering | 310 // requestAnimationFrame for non-blocking rendering |
| 311 if (this.__openChangedAsync) { | 311 if (this.__openChangedAsync) { |
| 312 cancelAnimationFrame(this.__openChangedAsync); | 312 window.cancelAnimationFrame(this.__openChangedAsync); |
| 313 } | 313 } |
| 314 if (this.opened) { | 314 if (this.opened) { |
| 315 if (this.withBackdrop) { | 315 if (this.withBackdrop) { |
| 316 this.backdropElement.prepare(); | 316 this.backdropElement.prepare(); |
| 317 } | 317 } |
| 318 this.__openChangedAsync = requestAnimationFrame(function() { | 318 this.__openChangedAsync = window.requestAnimationFrame(function() { |
| 319 this.__openChangedAsync = null; | 319 this.__openChangedAsync = null; |
| 320 this._prepareRenderOpened(); | 320 this._prepareRenderOpened(); |
| 321 this._renderOpened(); | 321 this._renderOpened(); |
| 322 }.bind(this)); | 322 }.bind(this)); |
| 323 } else { | 323 } else { |
| 324 this._renderClosed(); | 324 this._renderClosed(); |
| 325 } | 325 } |
| 326 }, | 326 }, |
| 327 | 327 |
| 328 _canceledChanged: function() { | 328 _canceledChanged: function() { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 this._focusedChild = nodeToSet; | 519 this._focusedChild = nodeToSet; |
| 520 } | 520 } |
| 521 }, | 521 }, |
| 522 | 522 |
| 523 /** | 523 /** |
| 524 * Refits if the overlay is opened and not animating. | 524 * Refits if the overlay is opened and not animating. |
| 525 * @protected | 525 * @protected |
| 526 */ | 526 */ |
| 527 _onIronResize: function() { | 527 _onIronResize: function() { |
| 528 if (this.__onIronResizeAsync) { | 528 if (this.__onIronResizeAsync) { |
| 529 cancelAnimationFrame(this.__onIronResizeAsync); | 529 window.cancelAnimationFrame(this.__onIronResizeAsync); |
| 530 this.__onIronResizeAsync = null; | 530 this.__onIronResizeAsync = null; |
| 531 } | 531 } |
| 532 if (this.opened && !this.__isAnimating) { | 532 if (this.opened && !this.__isAnimating) { |
| 533 this.__onIronResizeAsync = requestAnimationFrame(function() { | 533 this.__onIronResizeAsync = window.requestAnimationFrame(function() { |
| 534 this.__onIronResizeAsync = null; | 534 this.__onIronResizeAsync = null; |
| 535 this.refit(); | 535 this.refit(); |
| 536 }.bind(this)); | 536 }.bind(this)); |
| 537 } | 537 } |
| 538 }, | 538 }, |
| 539 | 539 |
| 540 /** | 540 /** |
| 541 * Will call notifyResize if overlay is opened. | 541 * Will call notifyResize if overlay is opened. |
| 542 * Can be overridden in order to avoid multiple observers on the same node. | 542 * Can be overridden in order to avoid multiple observers on the same node. |
| 543 * @protected | 543 * @protected |
| (...skipping 26 matching lines...) Expand all Loading... |
| 570 * the canceling (e.g. ESC keyboard event or click event outside the `iron-over
lay`). | 570 * the canceling (e.g. ESC keyboard event or click event outside the `iron-over
lay`). |
| 571 */ | 571 */ |
| 572 | 572 |
| 573 /** | 573 /** |
| 574 * Fired after the `iron-overlay` closes. | 574 * Fired after the `iron-overlay` closes. |
| 575 * @event iron-overlay-closed | 575 * @event iron-overlay-closed |
| 576 * @param {{canceled: (boolean|undefined)}} closingReason Contains `canceled` (
whether the overlay was canceled). | 576 * @param {{canceled: (boolean|undefined)}} closingReason Contains `canceled` (
whether the overlay was canceled). |
| 577 */ | 577 */ |
| 578 | 578 |
| 579 })(); | 579 })(); |
| OLD | NEW |