Permalink
Browse files

Fixed z-index bug with windows

git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@20345 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information...
1 parent a659f41 commit 6198af31bc5cd1d244508d359a32183df1708da6 cboulanger committed Jun 24, 2010
Showing with 10 additions and 3 deletions.
  1. +10 −3 source/class/dialog/Dialog.js
@@ -195,12 +195,19 @@ qx.Class.define("dialog.Dialog",
/*
* automatically add to application's root
*/
- qx.core.Init.getApplication().getRoot().add(this);
+ var root = qx.core.Init.getApplication().getRoot();
+ root.add(this);
/*
- * set a very high Z-Index
+ * make sure the dialog is above any opened window
*/
- this.setZIndex( 1E5 );
+ var maxWindowZIndex = 1E5;
+ var windows = root.getWindows();
+ for (var i = 0; i < windows.length; i++) {
+ var zIndex = windows[i].getZIndex();
+ maxWindowZIndex = Math.max(maxWindowZIndex, zIndex);
+ }
+ this.setZIndex( maxWindowZIndex +1 );
/*
* make it a focus root

0 comments on commit 6198af3

Please sign in to comment.