Skip to content

Dialog: Share maxZ among all dialog instances and only increase when necessary. Fixed #5388 - Dialog: Don't change z-index when already at the top #324

Closed
wants to merge 2 commits into from
View
8 ui/jquery.ui.dialog.js
@@ -248,8 +248,8 @@ $.widget("ui.dialog", {
return self._trigger( "focus", event );
}
- if ( options.zIndex > $.ui.dialog.maxZ ) {
- $.ui.dialog.maxZ = options.zIndex;
+ if ( options.zIndex >= $.ui.dialog.maxZ ) {
+ $.ui.dialog.maxZ = options.zIndex + 1;
}
if ( self.overlay ) {
$.ui.dialog.maxZ += 1;
@@ -264,8 +264,8 @@ $.widget("ui.dialog", {
scrollTop: self.element.attr( "scrollTop" ),
scrollLeft: self.element.attr( "scrollLeft" )
};
- $.ui.dialog.maxZ += 1;
- self.uiDialog.css( "z-index", $.ui.dialog.maxZ );
+ if( self.uiDialog.css( "z-index" ) < $.ui.dialog.maxZ )
+ self.uiDialog.css( "z-index", $.ui.dialog.maxZ += 1 );
self.element.attr( saveScroll );
self._trigger( "focus", event );
Something went wrong with that request. Please try again.