From 029db52f12c0a97f6e8a1eeb7fe872b4a772eb4e Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 17 Jul 2015 13:13:07 +0300 Subject: Fix IE8 centered window initial placement (#18498) Change-Id: I8809f31c27d9ad2860c3f21b21948312272db18f --- client/src/com/vaadin/client/ui/VOverlay.java | 14 +------------- .../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 { 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); -- cgit v1.2.3