| OLD | NEW |
| 1 | |
| 2 | |
| 3 /** | 1 /** |
| 4 Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or
shown, and displays | 2 Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or
shown, and displays |
| 5 on top of other content. It includes an optional backdrop, and can be used to im
plement a variety | 3 on top of other content. It includes an optional backdrop, and can be used to im
plement a variety |
| 6 of UI controls including dialogs and drop downs. Multiple overlays may be displa
yed at once. | 4 of UI controls including dialogs and drop downs. Multiple overlays may be displa
yed at once. |
| 7 | 5 |
| 8 ### Closing and canceling | 6 ### Closing and canceling |
| 9 | 7 |
| 10 A dialog may be hidden by closing or canceling. The difference between close and
cancel is user | 8 A dialog may be hidden by closing or canceling. The difference between close and
cancel is user |
| 11 intent. Closing generally implies that the user acknowledged the content on the
overlay. By default, | 9 intent. Closing generally implies that the user acknowledged the content on the
overlay. By default, |
| 12 it will cancel whenever the user taps outside it or presses the escape key. This
behavior is | 10 it will cancel whenever the user taps outside it or presses the escape key. This
behavior is |
| 13 configurable with the `no-cancel-on-esc-key` and the `no-cancel-on-outside-click
` properties. | 11 configurable with the `no-cancel-on-esc-key` and the `no-cancel-on-outside-click
` properties. |
| 14 `close()` should be called explicitly by the implementer when the user interacts
with a control | 12 `close()` should be called explicitly by the implementer when the user interacts
with a control |
| 15 in the overlay element. | 13 in the overlay element. When the dialog is canceled, the overlay fires an 'iron-
overlay-canceled' |
| 14 event. Call `preventDefault` on this event to prevent the overlay from closing. |
| 16 | 15 |
| 17 ### Positioning | 16 ### Positioning |
| 18 | 17 |
| 19 By default the element is sized and positioned to fit and centered inside the wi
ndow. You can | 18 By default the element is sized and positioned to fit and centered inside the wi
ndow. You can |
| 20 position and size it manually using CSS. See `Polymer.IronFitBehavior`. | 19 position and size it manually using CSS. See `Polymer.IronFitBehavior`. |
| 21 | 20 |
| 22 ### Backdrop | 21 ### Backdrop |
| 23 | 22 |
| 24 Set the `with-backdrop` attribute to display a backdrop behind the overlay. The
backdrop is | 23 Set the `with-backdrop` attribute to display a backdrop behind the overlay. The
backdrop is |
| 25 appended to `<body>` and is of type `<iron-overlay-backdrop>`. See its doc page
for styling | 24 appended to `<body>` and is of type `<iron-overlay-backdrop>`. See its doc page
for styling |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 */ | 175 */ |
| 177 close: function() { | 176 close: function() { |
| 178 this.opened = false; | 177 this.opened = false; |
| 179 this._setCanceled(false); | 178 this._setCanceled(false); |
| 180 }, | 179 }, |
| 181 | 180 |
| 182 /** | 181 /** |
| 183 * Cancels the overlay. | 182 * Cancels the overlay. |
| 184 */ | 183 */ |
| 185 cancel: function() { | 184 cancel: function() { |
| 185 var cancelEvent = this.fire('iron-overlay-canceled', undefined, {cancelabl
e: true}); |
| 186 if (cancelEvent.defaultPrevented) { |
| 187 return; |
| 188 } |
| 189 |
| 186 this.opened = false; | 190 this.opened = false; |
| 187 this._setCanceled(true); | 191 this._setCanceled(true); |
| 188 }, | 192 }, |
| 189 | 193 |
| 190 _ensureSetup: function() { | 194 _ensureSetup: function() { |
| 191 if (this._overlaySetup) { | 195 if (this._overlaySetup) { |
| 192 return; | 196 return; |
| 193 } | 197 } |
| 194 this._overlaySetup = true; | 198 this._overlaySetup = true; |
| 195 this.style.outline = 'none'; | 199 this.style.outline = 'none'; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 */ | 416 */ |
| 413 | 417 |
| 414 /** | 418 /** |
| 415 * Fired after the `iron-overlay` closes. | 419 * Fired after the `iron-overlay` closes. |
| 416 * @event iron-overlay-closed | 420 * @event iron-overlay-closed |
| 417 * @param {{canceled: (boolean|undefined)}} set to the `closingReason` attribute | 421 * @param {{canceled: (boolean|undefined)}} set to the `closingReason` attribute |
| 418 */ | 422 */ |
| 419 }; | 423 }; |
| 420 | 424 |
| 421 /** @polymerBehavior */ | 425 /** @polymerBehavior */ |
| 422 Polymer.IronOverlayBehavior = [Polymer.IronFitBehavior, Polymer.IronResizableB
ehavior, Polymer.IronOverlayBehaviorImpl]; | 426 Polymer.IronOverlayBehavior = [Polymer.IronFitBehavior, Polymer.IronResizableB
ehavior, Polymer.IronOverlayBehaviorImpl]; |
| 423 | |
| 424 | |
| OLD | NEW |