aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDavid Petersen <public@petersendidit.com>2013-01-23 19:12:25 -0600
committerDavid Petersen <public@petersendidit.com>2013-01-24 13:43:02 -0600
commit649f105229b2a24adc21cba2d56cb05a59711ccb (patch)
tree5f505d8cb58545bcab6327f53f6a8ce5267a04c3 /ui
parentf7f165c9f8281c5fc5d060eb7bfe09921a0aea82 (diff)
downloadjquery-ui-649f105229b2a24adc21cba2d56cb05a59711ccb.tar.gz
jquery-ui-649f105229b2a24adc21cba2d56cb05a59711ccb.zip
Dialog: Don't handle overlays on destory if there are not any. Fixed: #9004 - failed in _destroyOverlay when I destroy a modal dialog thau was never opened. Fixed: #9000 Dialog leaves broken event handler after close/destroy in certain cases
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.dialog.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index ef5787ef6..bfe37235e 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -704,11 +704,15 @@ $.widget( "ui.dialog", {
return;
}
- $.ui.dialog.overlayInstances--;
- if ( !$.ui.dialog.overlayInstances ) {
- this._off( this.document, "focusin" );
+ if ( this.overlay ) {
+ $.ui.dialog.overlayInstances--;
+
+ if ( !$.ui.dialog.overlayInstances ) {
+ this._off( this.document, "focusin" );
+ }
+ this.overlay.remove();
+ this.overlay = null;
}
- this.overlay.remove();
}
});