]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #2011, exception in IE7 when rendering shadow.
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Tue, 23 Sep 2008 12:15:43 +0000 (12:15 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Tue, 23 Sep 2008 12:15:43 +0000 (12:15 +0000)
svn changeset:5486/svn branch:trunk

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

index 61c368bf2a82f3f9ed014a4935a4b00b62d41323..a9e9453e5b02daa59d9cc4fd5a3e1c902114e363 100644 (file)
@@ -50,6 +50,7 @@ public class IToolkitOverlay extends PopupPanel {
         DOM.setStyleAttribute(getElement(), "zIndex", "" + Z_INDEX);
     }
 
+    @Override
     public void setPopupPosition(int left, int top) {
         super.setPopupPosition(left, top);
         if (shadow != null) {
@@ -57,6 +58,7 @@ public class IToolkitOverlay extends PopupPanel {
         }
     }
 
+    @Override
     public void show() {
         super.show();
         if (shadow != null) {
@@ -107,8 +109,18 @@ public class IToolkitOverlay extends PopupPanel {
 
         public void updateSizeAndPosition() {
             // Calculate proper z-index
-            String zIndex = DOM.getStyleAttribute(IToolkitOverlay.this
-                    .getElement(), "zIndex");
+            String zIndex = null;
+            if (IToolkitOverlay.this.isAttached()) {
+                // Odd behaviour with Windows Hosted Mode forces us to use a
+                // redundant try/catch block (See dev.itmill.com #2011)
+                try {
+                    zIndex = DOM.getStyleAttribute(IToolkitOverlay.this
+                            .getElement(), "zIndex");
+                } catch (Exception ignore) {
+                    // Ignored, will cause no harm, other than a little
+                    // eye-candy missing
+                }
+            }
             if (zIndex == null) {
                 zIndex = "" + Z_INDEX;
             }