mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: When animating dialog close, wait until after the animation completes before triggering the close event. Fixes #4207 - Dialog close event occurs too early with hide effect.
This commit is contained in:
parent
3342fb841a
commit
d94afbee78
@ -154,19 +154,24 @@ $.widget("ui.dialog", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
close: function(event) {
|
close: function(event) {
|
||||||
if (false === this._trigger('beforeclose', event)) {
|
var self = this;
|
||||||
|
|
||||||
|
if (false === self._trigger('beforeclose', event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(this.overlay && this.overlay.destroy());
|
(self.overlay && self.overlay.destroy());
|
||||||
this.uiDialog
|
self.uiDialog.unbind('keypress.ui-dialog');
|
||||||
.hide(this.options.hide)
|
|
||||||
.unbind('keypress.ui-dialog');
|
(self.options.hide
|
||||||
|
? self.uiDialog.hide(self.options.hide, function() {
|
||||||
|
self._trigger('close', event);
|
||||||
|
})
|
||||||
|
: self._trigger('close', event));
|
||||||
|
|
||||||
this._trigger('close', event);
|
|
||||||
$.ui.dialog.overlay.resize();
|
$.ui.dialog.overlay.resize();
|
||||||
|
|
||||||
this._isOpen = false;
|
self._isOpen = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
isOpen: function() {
|
isOpen: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user