aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-03-20 08:28:16 +0000
committerArtur Signell <artur.signell@itmill.com>2009-03-20 08:28:16 +0000
commit9b549761439c275fb5949833d97da289315e36c3 (patch)
treee0e48c7f9f77f6a1be3a256287f051017292d982 /src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
parenta075258a59523079e7d114d8514b442297d11172 (diff)
downloadvaadin-framework-9b549761439c275fb5949833d97da289315e36c3.tar.gz
vaadin-framework-9b549761439c275fb5949833d97da289315e36c3.zip
Merged "Test case and fix for #2702 - Window.center() fails the first time in certain cases"
svn changeset:7120/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
index 7de1f81349..915f4b521e 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java
@@ -341,23 +341,8 @@ public class IWindow extends IToolkitOverlay implements Container,
}
if (dynamicHeight && layoutRelativeHeight) {
- /*
- * Window height is undefined, layout is 100% high so the layout
- * should define the initial window height but on resize the layout
- * should be as high as the window. We fix the height immediately to
- * deal with this.
- */
-
- int h = contents.getOffsetHeight() + getExtraHeight();
- int w = contents.getOffsetWidth();
-
// Prevent resizing until height has been fixed
resizable = false;
-
- client.updateVariable(id, "height", h, false);
- client.updateVariable(id, "width", w, true);
- // ApplicationConnection.getConsole().log("Fixing window size to " +
- // w + "x" + h);
}
// we may have actions and notifications
@@ -429,6 +414,22 @@ public class IWindow extends IToolkitOverlay implements Container,
if (getOffsetHeight() > Window.getClientHeight()) {
setHeight(Window.getClientHeight() + "px");
}
+
+ if (dynamicHeight && layoutRelativeHeight) {
+ /*
+ * Window height is undefined, layout is 100% high so the layout
+ * should define the initial window height but on resize the layout
+ * should be as high as the window. We fix the height to deal with
+ * this.
+ */
+
+ int h = contents.getOffsetHeight() + getExtraHeight();
+ int w = contents.getOffsetWidth();
+
+ client.updateVariable(id, "height", h, false);
+ client.updateVariable(id, "width", w, true);
+ }
+
}
private void setNaturalWidth() {