diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-07-17 13:13:07 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-07-22 08:32:25 +0000 |
commit | 029db52f12c0a97f6e8a1eeb7fe872b4a772eb4e (patch) | |
tree | a4ea77980ca38c6dcb7ac63c53a58f50f81cad73 | |
parent | 4a10a70fbecdd52758ebc73512974501a02d5fdd (diff) | |
download | vaadin-framework-029db52f12c0a97f6e8a1eeb7fe872b4a772eb4e.tar.gz vaadin-framework-029db52f12c0a97f6e8a1eeb7fe872b4a772eb4e.zip |
Fix IE8 centered window initial placement (#18498)
Change-Id: I8809f31c27d9ad2860c3f21b21948312272db18f
-rw-r--r-- | client/src/com/vaadin/client/ui/VOverlay.java | 14 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/window/WindowConnector.java | 10 |
2 files changed, 10 insertions, 14 deletions
diff --git a/client/src/com/vaadin/client/ui/VOverlay.java b/client/src/com/vaadin/client/ui/VOverlay.java index e823e8ee80..3649afc74f 100644 --- a/client/src/com/vaadin/client/ui/VOverlay.java +++ b/client/src/com/vaadin/client/ui/VOverlay.java @@ -22,8 +22,6 @@ import java.util.logging.Logger; import com.google.gwt.animation.client.Animation; import com.google.gwt.aria.client.Roles; import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.IFrameElement; @@ -473,17 +471,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { if (isAnimationEnabled()) { new ResizeAnimation().run(POPUP_PANEL_ANIMATION_DURATION); } else { - if (BrowserInfo.get().isIE8()) { - Scheduler.get().scheduleFinally(new ScheduledCommand() { - - @Override - public void execute() { - positionOrSizeUpdated(1.0); - } - }); - } else { - positionOrSizeUpdated(1.0); - } + positionOrSizeUpdated(1.0); } current = null; } diff --git a/client/src/com/vaadin/client/ui/window/WindowConnector.java b/client/src/com/vaadin/client/ui/window/WindowConnector.java index 9b710981d8..8c23f712ad 100644 --- a/client/src/com/vaadin/client/ui/window/WindowConnector.java +++ b/client/src/com/vaadin/client/ui/window/WindowConnector.java @@ -17,6 +17,8 @@ package com.vaadin.client.ui.window; import java.util.logging.Logger; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; @@ -407,7 +409,13 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector window.centered = state.centered; // Ensure centering before setting visible (#16486) if (window.centered && getState().windowMode != WindowMode.MAXIMIZED) { - window.center(); + Scheduler.get().scheduleFinally(new ScheduledCommand() { + + @Override + public void execute() { + getWidget().center(); + } + }); } window.setVisible(true); |