]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Ensure dialogs have a z-index when calculating the max z-index. Fixex #5955...
authorjamiejag <git@jamiegegerson.com>
Tue, 16 Nov 2010 01:45:19 +0000 (17:45 -0800)
committerScott González <scott.gonzalez@gmail.com>
Fri, 19 Nov 2010 14:02:01 +0000 (09:02 -0500)
ui/jquery.ui.dialog.js

index ad9c183cef63c182fda23a3eb0594dc9aa176950..c2d5d3e16c095f2298e3957ca1437e33f6fe87b8 100644 (file)
@@ -228,7 +228,7 @@ $.widget("ui.dialog", {
 
        close: function(event) {
                var self = this,
-                       maxZ;
+                       maxZ, thisZ;
                
                if (false === self._trigger('beforeClose', event)) {
                        return;
@@ -257,7 +257,10 @@ $.widget("ui.dialog", {
                        maxZ = 0;
                        $('.ui-dialog').each(function() {
                                if (this !== self.uiDialog[0]) {
-                                       maxZ = Math.max(maxZ, $(this).css('z-index'));
+                                       thisZ = $(this).css('z-index');
+                                       if(!isNaN(thisZ)) {
+                                               maxZ = Math.max(maxZ, thisZ);
+                                       }
                                }
                        });
                        $.ui.dialog.maxZ = maxZ;