Skip to content

Commit 83d32c1

Browse files
committed
The zIndex of a dialog's overlay should be one less than that of the dialog.
1 parent 156df8f commit 83d32c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/unit/dialog/dialog_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ test("zIndex", function() {
469469
// At the moment, an explicit zIndex option lower than $.ui.dialog.maxZ will be ignored since 'open' calls
470470
// 'moveToTop'. Is this the desired behavior?
471471
el = $('<div></div>').dialog({zIndex: 1584 });
472-
equals(dlg().css('zIndex'), $.ui.dialog.maxZ, "explicit zIndex, lower than $.ui.dialog.maxZ, is ignored");
472+
equals(dlg().css('zIndex'), $.ui.dialog.maxZ, "explicit zIndex at instantiation below $.ui.dialog.maxZ is ignored");
473473
el.remove();
474474
});
475475

ui/jquery.ui.dialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,15 +602,15 @@ $.widget("ui.dialog", {
602602
$.ui.dialog.maxZ = value;
603603

604604
if ( self.overlay ) {
605-
$.ui.dialog.maxZ += 1;
606605
$.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ;
606+
$.ui.dialog.maxZ += 1;
607607
}
608608
}
609609

610610
value = $.ui.dialog.maxZ;
611611
}
612612

613-
self.overlay && self.overlay.$el.css( "z-index", value > 0 ? value : 0 );
613+
self.overlay && self.overlay.$el.css( "z-index", value - 1 );
614614
uiDialog.css( "z-index", value );
615615

616616
break;

0 commit comments

Comments
 (0)