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.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 3d38df4c0..efc445693 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -750,7 +750,10 @@ $.extend($.ui.dialog.overlay, {
},
destroy: function($el) {
- this.oldInstances.push(this.instances.splice($.inArray($el, this.instances), 1)[0]);
+ var indexOf = $.inArray($el, this.instances);
+ if (indexOf != -1){
+ this.oldInstances.push(this.instances.splice(indexOf, 1)[0]);
+ }
if (this.instances.length === 0) {
$([document, window]).unbind('.dialog-overlay');