summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAutomerge <automerge@vaadin.com>2012-05-10 13:07:21 +0000
committerAutomerge <automerge@vaadin.com>2012-05-10 13:07:21 +0000
commitc8a4ca73ac23373683cab03cb8aa46ca5ea6fa7c (patch)
tree8ac4b6ce847b7328ad805b05cce0cc41f0fb5402 /src/com
parentf6bfd75b703aa199d2ef7e956d5ec7422a507d85 (diff)
downloadvaadin-framework-c8a4ca73ac23373683cab03cb8aa46ca5ea6fa7c.tar.gz
vaadin-framework-c8a4ca73ac23373683cab03cb8aa46ca5ea6fa7c.zip
[merge from 6.7] Tweaks to #7931 based on review.
svn changeset:23708/svn branch:6.8
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VView.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java
index 8f8a6ab4b3..d500c56e52 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VView.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java
@@ -61,10 +61,18 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
private ShortcutActionHandler actionHandler;
- /** stored size for IE resize optimization */
+ /*
+ * Last known window size used to detect whether VView should be layouted
+ * again. Detection must be based on window size, because the VView size
+ * might be fixed and thus not automatically adapt to changed window sizes.
+ */
private int windowWidth;
private int windowHeight;
+ /*
+ * Last know view size used to detect whether new dimensions should be sent
+ * to the server.
+ */
private int viewWidth;
private int viewHeight;
@@ -146,6 +154,13 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
VConsole.log("New window height: " + windowHeight);
}
if (changed) {
+ /*
+ * If the window size has changed, layout the VView again and send
+ * new size to the server if the size changed. (Just checking VView
+ * size would cause us to ignore cases when a relatively sized VView
+ * should shrink as the content's size is fixed and would thus not
+ * automatically shrink.)
+ */
VConsole.log("Running layout functions due to window resize");
connection.runDescendentsLayout(VView.this);
Util.runWebkitOverflowAutoFix(getElement());
@@ -493,8 +508,9 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
* Send new dimensions to the server.
*/
private void sendClientResized() {
- int newViewHeight = getElement().getClientHeight();
- int newViewWidth = getElement().getClientWidth();
+ Element parentElement = getElement().getParentElement();
+ int newViewHeight = parentElement.getClientHeight();
+ int newViewWidth = parentElement.getClientWidth();
// Send the view dimensions if they have changed
if (newViewHeight != viewHeight || newViewWidth != viewWidth) {