Permalink
Browse files

The zIndex of a dialog's overlay should be one less than that of the …

…dialog.
  • Loading branch information...
1 parent 156df8f commit 83d32c13f9bc4339d21714fcc3829a86625633ae @PaulUithol committed Aug 2, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 tests/unit/dialog/dialog_options.js
  2. +2 −2 ui/jquery.ui.dialog.js
@@ -469,7 +469,7 @@ test("zIndex", function() {
// At the moment, an explicit zIndex option lower than $.ui.dialog.maxZ will be ignored since 'open' calls
// 'moveToTop'. Is this the desired behavior?
el = $('<div></div>').dialog({zIndex: 1584 });
- equals(dlg().css('zIndex'), $.ui.dialog.maxZ, "explicit zIndex, lower than $.ui.dialog.maxZ, is ignored");
+ equals(dlg().css('zIndex'), $.ui.dialog.maxZ, "explicit zIndex at instantiation below $.ui.dialog.maxZ is ignored");
el.remove();
});
View
@@ -602,15 +602,15 @@ $.widget("ui.dialog", {
$.ui.dialog.maxZ = value;
if ( self.overlay ) {
- $.ui.dialog.maxZ += 1;
$.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ;
+ $.ui.dialog.maxZ += 1;
}
}
value = $.ui.dialog.maxZ;
}
- self.overlay && self.overlay.$el.css( "z-index", value > 0 ? value : 0 );
+ self.overlay && self.overlay.$el.css( "z-index", value - 1 );
uiDialog.css( "z-index", value );
break;

0 comments on commit 83d32c1

Please sign in to comment.