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