gwt /
gwt /
aa481e194b37d1d830d56191ad9f4364d0c124f7 PopupPanel positioning changes. Currently, PopupPanel.center() requires that
the popup be showing before this call is made. The center() method has been
changed so that the popup will be centered first, and then shown if the popup
is not already showing. Now, developers no longer have to call show() before
center(), which prevents the effect of the popup jumping from its original
position to its centered position.
PopupPanel positioning changes. A new method,
PopupPanel.setPopupPositionAndShow(PopupPanel.PositionCallback) has been added
to allow developers to position a popup before it is shown.
PopupPanel.PositionCallback is an interface with one method: setPosition(int
offsetWidth, int offsetHeight). Since the width and height of the popup are
made available to the developer, positioning based on the width and height of
the popup can be done even before the popup is shown. Previously, developers
would have to show the popup, and then set its position. This would cause the
"jump" effect described above. PopupPanelExample has been updated to provide an
example of this method's usage.
Fix issue #1231. PopupPanel's show() method has been changed to set the
positioning of the popup to absolute BEFORE the popup is attached to the DOM.
This prevents the popup from starting out in its static position, and jumping
to its absolute position when shown.
When a PopupPanel is constructed, its left and top positions are initialized to
(0,0). This is done to handle the case where the PopupPanel is shown before its
position is set. If left and top are not defined, then the PopupPanel will
appear at an undefined location on the screen, which may cause the annoying
effect of the scrollbars quickly appearing and disappearing.
When a PopupPanel is hidden, it is detached from the DOM. Since PopupPanel
inherits from AbsolutePanel, detaching from the DOM means that the positioning
of the PopupPanel will be changed to "static", and the left and top attributes
will be cleared out. Unfortunately, when the PopupPanel is shown again, its
left and top attributes will be undefined. AbsolutePanel's
changeToStaticPositioning() method has been changed so that the the left and
top attributes are no longer cleared out; only the positioning is changed to
static.
Issue: 1231
Patch by: rdayal
Review by: jgw
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1243 8db76d5a-ed1c-0410-87a9-c151d255dfc7
4 files changed