aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-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();
}
});