From: Artur Signell Date: Mon, 29 Jun 2009 13:59:01 +0000 (+0000) Subject: Fix for #3099 - PopupView is shown off screen X-Git-Tag: 6.7.0.beta1~2700 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f7a0931c2d4242442c14fe88b949df7357884a90;p=vaadin-framework.git Fix for #3099 - PopupView is shown off screen svn changeset:8264/svn branch:6.0 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java index c6041d71d1..1bdefe6372 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java @@ -160,7 +160,7 @@ public class VPopupView extends HTML implements Container { int left = hostHorizontalCenter - offsetWidth / 2; int top = hostVerticalCenter - offsetHeight / 2; - // Superclass takes care of top and left + // Don't show the popup outside the screen. if ((left + offsetWidth) > windowRight) { left -= (left + offsetWidth) - windowRight; } @@ -169,6 +169,14 @@ public class VPopupView extends HTML implements Container { top -= (top + offsetHeight) - windowBottom; } + if (left < 0) { + left = 0; + } + + if (top < 0) { + top = 0; + } + popup.setPopupPosition(left, top); popup.setVisible(true);