List of usage examples for com.google.gwt.dom.client Document getBodyOffsetTop
public int getBodyOffsetTop()
From source file:org.cruxframework.crux.smartfaces.client.dialog.PopupPanel.java
License:Apache License
/** * Sets the popup's position relative to the browser's client area. The * popup's position may be set before calling {@link #show()}. * //from ww w .ja v a2 s . com * @param left * the left position, in pixels * @param top * the top position, in pixels */ public void setPosition(int left, int top) { if (centered) { uncentralizeMe(); } // Account for the difference between absolute position and the // body's positioning context. Document document = Document.get(); left -= document.getBodyOffsetLeft(); top -= document.getBodyOffsetTop(); this.left = left; this.top = top; setPopupPositionStyle(left, top); }