]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1108
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 16 Nov 2007 09:00:03 +0000 (09:00 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 16 Nov 2007 09:00:03 +0000 (09:00 +0000)
svn changeset:2835/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupCalendar.java

index 0242234c0df749274b02b27415242bf969bdd443..86e67cf1b273483155679336a38f6f3d45335b38 100644 (file)
@@ -52,12 +52,13 @@ public class IPopupCalendar extends ITextualDate implements Paintable,
             int h = calendar.getOffsetHeight();\r
             int t = calendarToggle.getAbsoluteTop();\r
             int l = calendarToggle.getAbsoluteLeft();\r
-            if (l + w > Window.getClientWidth()) {\r
-                l = Window.getClientWidth() - w;\r
+            if (l + w > Window.getClientWidth() + Window.getScrollLeft()) {\r
+                l = Window.getClientWidth() + Window.getScrollLeft() - w;\r
             }\r
-            if (t + h > Window.getClientHeight()) {\r
-                t = Window.getClientHeight() - h\r
-                        - calendarToggle.getOffsetHeight() - 2;\r
+            if (t + h > Window.getClientHeight() + Window.getScrollTop()) {\r
+                t = Window.getClientHeight() + Window.getScrollTop() - h\r
+                        - calendarToggle.getOffsetHeight() - 30;\r
+                l += calendarToggle.getOffsetWidth();\r
             }\r
             popup.setPopupPosition(l, t + calendarToggle.getOffsetHeight() + 2);\r
             popup.setWidth(w + "px");\r