summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-04-15 08:59:01 +0300
committerVaadin Code Review <review@vaadin.com>2016-04-28 15:18:36 +0000
commit9006dbdf5a2d6d34d6322a8affc743087b5b46f5 (patch)
tree5baee41f6f106482350148320f84f005a518ee78 /client
parentc9b1df6d5e9847ef4d5a6e810df22612ecbddca6 (diff)
downloadvaadin-framework-9006dbdf5a2d6d34d6322a8affc743087b5b46f5.tar.gz
vaadin-framework-9006dbdf5a2d6d34d6322a8affc743087b5b46f5.zip
Use the correct window height when comparing to browser window height (#19590)
Change-Id: I7fdecab93fa6730e63e3ba7f0df3a67f3020c19c
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java b/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java
index 9ea3c8bb68..8ddf099e28 100644
--- a/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java
@@ -216,6 +216,17 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector
public void layout() {
LayoutManager lm = getLayoutManager();
VWindow window = getWidget();
+
+ // ensure window is not larger than browser window
+ if (window.getOffsetWidth() > Window.getClientWidth()) {
+ window.setWidth(Window.getClientWidth() + "px");
+ lm.setNeedsMeasure(getContent());
+ }
+ if (window.getOffsetHeight() > Window.getClientHeight()) {
+ window.setHeight(Window.getClientHeight() + "px");
+ lm.setNeedsMeasure(getContent());
+ }
+
ComponentConnector content = getContent();
boolean hasContent = (content != null);
Element contentElement = window.contentPanel.getElement();
@@ -414,14 +425,6 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector
});
}
window.setVisible(true);
-
- // ensure window is not larger than browser window
- if (window.getOffsetWidth() > Window.getClientWidth()) {
- window.setWidth(Window.getClientWidth() + "px");
- }
- if (window.getOffsetHeight() > Window.getClientHeight()) {
- window.setHeight(Window.getClientHeight() + "px");
- }
}
// Need to override default because of window mode