]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #2503 and "broken shadow" issue in IE7, never add absolutely positioned element...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 6 Feb 2009 14:24:13 +0000 (14:24 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 6 Feb 2009 14:24:13 +0000 (14:24 +0000)
svn changeset:6754/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IToolkitOverlay.java

index 95b94903dd8127c200a72481a1e6b0295526c4ad..53862675ebed040dc199e1f460f46fefaf6abdad 100644 (file)
@@ -132,9 +132,6 @@ public class IToolkitOverlay extends PopupPanel {
     public void show() {
         super.show();
         if (shadow != null) {
-            DOM
-                    .insertBefore(RootPanel.get().getElement(), shadow,
-                            getElement());
             if (isAnimationEnabled()) {
                 ShadowAnimation sa = new ShadowAnimation();
                 sa.run(200);
@@ -211,10 +208,9 @@ public class IToolkitOverlay extends PopupPanel {
      */
     private void updateShadowSizeAndPosition(double progress) {
         // Don't do anything if overlay element is not attached
-        if (!isAttached()) {
+        if (!isAttached() || !isVisible()) {
             return;
         }
-
         // Calculate proper z-index
         String zIndex = null;
         try {
@@ -267,6 +263,12 @@ public class IToolkitOverlay extends PopupPanel {
         DOM.setStyleAttribute(shadow, "height", height + "px");
         DOM.setStyleAttribute(shadow, "top", y + "px");
         DOM.setStyleAttribute(shadow, "left", x + "px");
+
+        // attach to dom if not there already
+        if (shadow.getParentElement() == null) {
+            RootPanel.get().getElement().insertBefore(shadow, getElement());
+        }
+
     }
 
     protected class ShadowAnimation extends Animation {