diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-28 18:08:25 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-28 18:08:25 +0000 |
commit | 7dac3bdccea22bd357062d5726b1383647628a6b (patch) | |
tree | 2b9f3ee1babeb1f0abb42b50c60205d9f4a6b81a /src/com/itmill | |
parent | 751af0244bee05184cae27aeabd3223c25163983 (diff) | |
download | vaadin-framework-7dac3bdccea22bd357062d5726b1383647628a6b.tar.gz vaadin-framework-7dac3bdccea22bd357062d5726b1383647628a6b.zip |
recatored shadow position handling, avoids regression when updating to GWT 1.6
svn changeset:7553/svn branch:6.0
Diffstat (limited to 'src/com/itmill')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IToolkitOverlay.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IToolkitOverlay.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IToolkitOverlay.java index 763d75c3af..0ea4f14133 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IToolkitOverlay.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IToolkitOverlay.java @@ -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 |