update components
This commit is contained in:
parent
02e924e3c5
commit
05b25af69f
55 changed files with 1554 additions and 907 deletions
|
@ -212,10 +212,11 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
},
|
||||
|
||||
/**
|
||||
* Cancels the overlay.
|
||||
* Cancels the overlay.
|
||||
* @param {?Event} event The original event
|
||||
*/
|
||||
cancel: function() {
|
||||
var cancelEvent = this.fire('iron-overlay-canceled', undefined, {cancelable: true});
|
||||
cancel: function(event) {
|
||||
var cancelEvent = this.fire('iron-overlay-canceled', event, {cancelable: true});
|
||||
if (cancelEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
@ -326,6 +327,7 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
|
||||
// tasks which must occur before opening; e.g. making the element visible
|
||||
_prepareRenderOpened: function() {
|
||||
|
||||
this._manager.addOverlay(this);
|
||||
|
||||
this._preparePositioning();
|
||||
|
@ -335,6 +337,12 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
if (this.withBackdrop) {
|
||||
this.backdropElement.prepare();
|
||||
}
|
||||
|
||||
// Safari will apply the focus to the autofocus element when displayed for the first time,
|
||||
// so we blur it. Later, _applyFocus will set the focus if necessary.
|
||||
if (this.noAutoFocus && document.activeElement === this._focusNode) {
|
||||
this._focusNode.blur();
|
||||
}
|
||||
},
|
||||
|
||||
// tasks which cause the overlay to actually open; typically play an
|
||||
|
@ -405,7 +413,7 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
if (this.noCancelOnOutsideClick) {
|
||||
this._applyFocus();
|
||||
} else {
|
||||
this.cancel();
|
||||
this.cancel(event);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -415,7 +423,7 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
if (this._manager.currentOverlay() === this &&
|
||||
!this.noCancelOnEscKey &&
|
||||
event.keyCode === ESC) {
|
||||
this.cancel();
|
||||
this.cancel(event);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -447,6 +455,7 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
* Fired when the `iron-overlay` is canceled, but before it is closed.
|
||||
* Cancel the event to prevent the `iron-overlay` from closing.
|
||||
* @event iron-overlay-canceled
|
||||
* @param {?Event} event The event in case the user pressed ESC or clicked outside the overlay
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue