From: Matti Tahvonen Date: Tue, 14 Aug 2007 13:15:05 +0000 (+0000) Subject: relocated scroll pos announcement to document body to avoid absolute layout problems X-Git-Tag: 6.7.0.beta1~6104 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=56357f6c01a633e169277a031af17a10c46b6a74;p=vaadin-framework.git relocated scroll pos announcement to document body to avoid absolute layout problems svn changeset:2009/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java index 83e2b558f5..830d92deda 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java @@ -390,6 +390,13 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll } } + protected void onDetach() { + super.onDetach(); + if(scrollPositionElement != null) + DOM.removeChild(DOM.getParent(scrollPositionElement), + scrollPositionElement); + } + /** * Run only once when component is attached and received its initial * content. This function : @@ -515,19 +522,19 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll if(scrollPositionElement == null) { scrollPositionElement = DOM.createDiv(); DOM.setAttribute(scrollPositionElement, "className", "i-table-scrollposition"); - DOM.appendChild(getElement(), scrollPositionElement); + DOM.appendChild(RootPanel.get().getElement(), scrollPositionElement); } + + DOM.setStyleAttribute(scrollPositionElement, "left", ( - DOM.getAbsoluteLeft(getElement()) + + DOM.getAbsoluteLeft(getElement()) + DOM.getIntAttribute(getElement(), "offsetWidth")/2 - 75 ) + "px"); DOM.setStyleAttribute(scrollPositionElement, "top", ( - DOM.getAbsoluteTop(getElement()) + - DOM.getIntAttribute(getElement(), "offsetHeight")/2 - - 20 + DOM.getAbsoluteTop(getElement()) ) + "px"); int last = (firstRowInViewPort + pageLength); @@ -542,7 +549,7 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll if(scrollPositionElement != null) DOM.setStyleAttribute(scrollPositionElement, "display", "none"); } - + private class RowRequestHandler extends Timer { private int reqFirstRow = 0;