]> source.dussan.org Git - vaadin-framework.git/commitdiff
recatored shadow position handling, avoids regression when updating to GWT 1.6
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 28 Apr 2009 18:08:25 +0000 (18:08 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 28 Apr 2009 18:08:25 +0000 (18:08 +0000)
svn changeset:7553/svn branch:6.0

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

index 763d75c3af6dd787b4701044df89d0fa1628f298..0ea4f14133036537cde124f3dfc809ae4d02eb25 100644 (file)
@@ -84,7 +84,9 @@ public class IToolkitOverlay extends PopupPanel {
 
             addPopupListener(new PopupListener() {
                 public void onPopupClosed(PopupPanel sender, boolean autoClosed) {
-                    DOM.removeChild(RootPanel.get().getElement(), shadow);
+                    if (shadow.getParentElement() != null) {
+                        shadow.getParentElement().removeChild(shadow);
+                    }
                 }
             });
         }
@@ -144,6 +146,15 @@ public class IToolkitOverlay extends PopupPanel {
         }
     }
 
+    @Override
+    public void setVisible(boolean visible) {
+        super.setVisible(visible);
+        if (shadow != null) {
+            shadow.getStyle().setProperty("visibility",
+                    visible ? "visible" : "hidden");
+        }
+    }
+
     /*
      * Needed to position overlays on top of native SELECT elements in IE6. See
      * bug #2004
@@ -206,16 +217,16 @@ public class IToolkitOverlay extends PopupPanel {
      *            A value between 0.0 and 1.0, indicating the progress of the
      *            animation (0=start, 1=end).
      */
-    private void updateShadowSizeAndPosition(double progress) {
+    private void updateShadowSizeAndPosition(final double progress) {
         // Don't do anything if overlay element is not attached
-        if (!isAttached() || !isVisible()) {
+        if (!isAttached()) {
             return;
         }
         // Calculate proper z-index
         String zIndex = null;
         try {
-            // Odd behaviour with Windows Hosted Mode forces us to use this
-            // redundant try/catch block (See dev.itmill.com #2011)
+            // Odd behaviour with Windows Hosted Mode forces us to use
+            // this redundant try/catch block (See dev.itmill.com #2011)
             zIndex = DOM.getStyleAttribute(getElement(), "zIndex");
         } catch (Exception ignore) {
             // Ignored, will cause no harm
@@ -255,7 +266,8 @@ public class IToolkitOverlay extends PopupPanel {
         width = (int) (width * progress);
         height = (int) (height * progress);
 
-        // Opera needs some shaking to get parts of the shadow showing properly
+        // Opera needs some shaking to get parts of the shadow showing
+        // properly
         // (ticket #2704)
         if (BrowserInfo.get().isOpera()) {
             // Clear the height of all middle elements