Opened 10 years ago
Closed 5 years ago
#12791 closed defect (patchwelcome)
Dialog: forces start zIndex to 950
Reported by: | Michael Schall | Owned by: | bill |
---|---|---|---|
Priority: | low | Milestone: | 1.13 |
Component: | Dijit | Version: | 1.6.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The zIndex used for the dialog should look at the domNode that will be used as the dialog for a zIndex value to start with.
We have a case where we need the dialog zIndex to start higher than 950. We set the desired zIndex through css. The following change to dijit.Dialog.js makes this possible.
For backward compatibility, we will take the Math.max of how the current code calculates the zIndex and the zIndex of the domNode we will be showing (bitwise or'ed with 0 in case the zIndex of the domNode is "auto"). The Math.max should also cater for showing different domNodes with different initial zIndex defined.
-
.js
old new 492 492 } 493 493 494 494 // Set z-index a bit above previous dialog 495 var zIndex = ds[ds.length-1].dialog ? ds[ds.length-1].zIndex + 2 : 950;495 var zIndex = Math.max(ds[ds.length-1].dialog ? ds[ds.length-1].zIndex + 2 : 950, dojo.style(dialog.domNode, 'zIndex') | 0); 496 496 if(ds.length == 1){ // first dialog 497 497 underlay.show(); 498 498 }
Change History (6)
comment:1 Changed 10 years ago by
Priority: | high → normal |
---|---|
Summary: | dijit.Dialog forces start zIndex to 950 → Dialog: forces start zIndex to 950 |
comment:2 Changed 10 years ago by
I would be fine with an option to set the begin index. I just thought reading it from css would be a cleaner way to do it. This way the developer doesn't have to set a "private" variable (which can change between minor versions) to change where the zIndex starts.
The Math.max is really just to keep backward compatibility with the hard coded 950. But also guarantees that the zIndex used is always ever increasing no matter what the order of dialogs opening and their css zIndex values.
comment:3 Changed 10 years ago by
Owner: | set to bill |
---|
comment:4 Changed 8 years ago by
Priority: | high → low |
---|
comment:5 Changed 8 years ago by
Milestone: | tbd → future |
---|
comment:6 Changed 5 years ago by
Milestone: | future → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | new → closed |
Given that no one has shown interest in creating a patch in the past 4+ years, I'm closing this as patchwelcome.
I see what you are saying in general.
Note that the dijit.popup code handles this by it's _beginZIndex setting, and note that Dialogs and popups are connected since Dialogs often have popups (like a Dialog containing a DateTextBox)... so the choice of 950 for Dialogs and 1000 for popups is not an accident. Thus I'm not sure that reading the z-index of a dialog from CSS is the best solution.