Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

4 participants

@kborchers
Owner

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

@kborchers kborchers 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
c604499
@gnarf

Why +1?

@gnarf
Owner

I also think that we should leave $.ui.dialog.maxZ instead of creating the private var

@kborchers
Owner

Not sure why I changed $.ui.dialog.maxZ. I probably had something else broken and changed that then forgot to change it back. As for the +1, that is necessary if there are 2+ dialogs with datepickers in each. Without it, if you have 2 overlapping dialogs and you activate the datepicker in the lower dialog, the datepicker is on top of the upper dialog but the lower dialog doesn't move to the top.

@gnarf
Owner

The only thing that bothers me on this pull anymore is the fact that we are basically ignoring options.zIndex at this point (aside from using it as a "starting" point). @scott_gonzalez / @jzaefferer have a better opinion?

@scottgonzalez

I've got an idea for a .ui-front class that will "do all magic." Let's see if my new idea works before deciding if we should land this.

@jzaefferer jzaefferer referenced this pull request
Merged

Dialog Redesign #787

@jzaefferer
Owner

Don't need this anymore since 3829a37 landed.

@jzaefferer jzaefferer closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2011
  1. @kborchers

    Dialog: Share maxZ among all dialog instances and only increase when …

    kborchers authored
    …necessary. Fixed #5388 - Dialog: Don't change z-index when already at the top
Commits on Jun 9, 2011
  1. @kborchers
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 ui/jquery.ui.dialog.js
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.