Two quick issues I found with the LightBox implementation:
- The centering code does not work when the page is scrolled (the popup ends up in the middle of the entire page, not the viewable area)
- The control should either not center the child dialog at all, or at least provide a boolean flag as to whether to do it or not.
Logged In: NO
There's a much easier fix for this under 1.4 and 1.5 (which I've been using, and it centers using the built in center code in GWT 1.4+, which works for scrolled pages as well). This leaves the choice up to the user as to whether they want to center or not:
public void show ()
{
int w = getWidth();
int h = getHeight();
background.setWidth(Integer.toString(w));
background.setHeight(Integer.toString(h));
background.setWidget(png = new PNGImage("../../images/lightbox.png", w, h));
background.setPopupPosition(0, 0);
hideSelects();
background.show();
backgroundFixup(background.getElement());
child.show();
}
Logged In: YES
user_id=1244935
Originator: NO
See patch 1892492 for a full corrected code.