]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #3882, tooltips now positioned on top of the screen if they don't fit below...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 28 Dec 2009 12:57:14 +0000 (12:57 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 28 Dec 2009 12:57:14 +0000 (12:57 +0000)
svn changeset:10552/svn branch:6.2

src/com/vaadin/terminal/gwt/client/VTooltip.java

index b42b4f3bf31aff2896e2de99f17b4917f014a9c3..f9a3c70c6154f4eecd2be4ed630a8cb234ad72b9 100644 (file)
@@ -91,6 +91,11 @@ public class VTooltip extends VOverlay {
                     if (y + offsetHeight + MARGIN - Window.getScrollTop() > Window
                             .getClientHeight()) {
                         y = tooltipEventMouseY - 5 - offsetHeight;
+                        if (y - Window.getScrollTop() < 0) {
+                            // tooltip does not fit on top of the mouse either,
+                            // put it at the top of the screen
+                            y = Window.getScrollTop();
+                        }
                     }
 
                     setPopupPosition(x, y);