Menu

#28 LightBox centering child issues

open
nobody
None
5
2007-07-18
2007-07-18
RustyShelf
No

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.

Discussion

  • Nobody/Anonymous

    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();
    }

     
  • pby

    pby - 2008-02-13

    Logged In: YES
    user_id=1244935
    Originator: NO

    See patch 1892492 for a full corrected code.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.