diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-04-02 02:00:45 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-04-02 02:00:45 +0000 |
commit | 8936687c184d717b593bd51a41e3c71f4214afc9 (patch) | |
tree | 118dcf2ac11694bbb839bbfc0d0c3edf5e311d10 | |
parent | fbb912524dd61e56fe3824483396b666ac3a3a13 (diff) | |
download | jquery-ui-8936687c184d717b593bd51a41e3c71f4214afc9.tar.gz jquery-ui-8936687c184d717b593bd51a41e3c71f4214afc9.zip |
Dialog: Fixed the case where you open two modal dialogs and then close the top dialog and inputs in the first dialog were no longer usable - Fixes #4309.
-rw-r--r-- | ui/ui.dialog.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index cbd0b107c..d8b348c9b 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -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() { @@ -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() { |