@@ -442,7 +442,7 @@ test("width", function() {
442
442
} ) ;
443
443
444
444
test ( "zIndex" , function ( ) {
445
- expect ( 6 ) ;
445
+ expect ( 9 ) ;
446
446
447
447
el = $ ( '<div></div>' ) . dialog ( { autoOpen : false } ) ;
448
448
equals ( dlg ( ) . css ( 'zIndex' ) , 1000 , "default zIndex" ) ;
@@ -454,11 +454,16 @@ test("zIndex", function() {
454
454
equals ( dlg ( ) . css ( 'zIndex' ) , $ . ui . dialog . maxZ , "default zIndex" ) ;
455
455
el . remove ( ) ;
456
456
457
- // The z-index will always be 1 higher than requested if 'moveToTop' gets called, such as when 'autoOpen' is true.
458
- el = $ ( '<div></div>' ) . dialog ( { zIndex : 2932 } ) ;
459
- equals ( dlg ( ) . css ( 'zIndex' ) , 2932 + 1 , "explicit zIndex" ) ;
457
+ // The z-index will be 1 higher than requested if 'moveToTop' gets called, such as when 'autoOpen' is true.
458
+ newZIndex = $ . ui . dialog . maxZ + 2932 ;
459
+ el = $ ( '<div></div>' ) . dialog ( { zIndex : newZIndex } ) ;
460
+ equals ( dlg ( ) . css ( 'zIndex' ) , newZIndex + 1 , "explicit zIndex" ) ;
461
+ equals ( el . dialog ( 'option' , 'zIndex' ) , newZIndex , 'get works for zIndex' ) ;
462
+ equals ( newZIndex + 1 , $ . ui . dialog . maxZ , '$.ui.dialog.maxZ is updated to the new value' ) ;
463
+
460
464
el . dialog ( 'option' , 'zIndex' , 1748 ) ;
461
465
equals ( dlg ( ) . css ( 'zIndex' ) , 1748 , 'explicit zIndex after init' ) ;
466
+ equals ( el . dialog ( 'option' , 'zIndex' ) , 1748 ) ;
462
467
el . remove ( ) ;
463
468
464
469
// At the moment, an explicit zIndex option lower than $.ui.dialog.maxZ will be ignored since 'open' calls
0 commit comments