Skip to content

Commit

Permalink
Dialog: Fixed the case where you open two modal dialogs and then clos…
Browse files Browse the repository at this point in the history
…e the top dialog and inputs in the first dialog were no longer usable - Fixes #4309.
  • Loading branch information
scottgonzalez committed Apr 2, 2009
1 parent fbb9125 commit 8936687
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ui/ui.dialog.js
Expand Up @@ -172,6 +172,17 @@ $.widget("ui.dialog", {
$.ui.dialog.overlay.resize();

self._isOpen = false;

// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
if (self.options.modal) {
var maxZ = 0;
$('.ui-dialog').each(function() {
if (this != self.uiDialog[0]) {
maxZ = Math.max(maxZ, $(this).css('z-index'));
}
});
$.ui.dialog.maxZ = maxZ;
}
},

isOpen: function() {
Expand Down Expand Up @@ -572,6 +583,13 @@ $.extend($.ui.dialog.overlay, {
}

$el.remove();

// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
var maxZ = 0;
$.each(this.instances, function() {
maxZ = Math.max(maxZ, this.css('z-index'));
});
this.maxZ = maxZ;
},

height: function() {
Expand Down

0 comments on commit 8936687

Please sign in to comment.