From 9da215a2e60aa77f752a92bc688c79207f9b799a Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 7 Nov 2007 07:31:32 +0000 Subject: [PATCH] reverted back old layout function, new one didn't work with IE's svn changeset:2725/svn branch:trunk --- .../terminal/gwt/client/ui/IPanel.java | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java index 6bcaf49d6e..7d8edac897 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java @@ -114,33 +114,32 @@ public class IPanel extends SimplePanel implements Paintable, if (height != null && height != "") { // need to fix containers height properly DOM.setStyleAttribute(getElement(), "height", height); - //boolean hasChildren = getWidget() != null; - //Element contentEl = null; - //String origPositioning = null; if (hasChildren) { // remove - //children temporary form normal flow to detect proper // size - //contentEl = getWidget().getElement(); origPositioning = - //DOM.getStyleAttribute(contentEl, "position"); - //DOM.setStyleAttribute(contentEl, "position", "absolute"); } - //DOM.setStyleAttribute(contentNode, "height", ""); int availableH = - //DOM.getElementPropertyInt(getElement(), "clientHeight"); - // - //int usedH = DOM .getElementPropertyInt(bottomDecoration, - //"offsetTop") + DOM.getElementPropertyInt(bottomDecoration, - //"offsetHeight"); - - DOM.setStyleAttribute(contentNode, "height", "1px"); DOM.setStyleAttribute(contentNode, "overflow", "hidden"); - int availableH = DOM.getElementPropertyInt(getElement(), - "offsetHeight"); - DOM.setStyleAttribute(getElement(), "height", ""); - int usedH = DOM.getElementPropertyInt(getElement(), "offsetHeight"); + boolean hasChildren = getWidget() != null; + Element contentEl = null; + String origPositioning = null; + if (hasChildren) { + // remove children temporary form normal flow to detect proper + // size + contentEl = getWidget().getElement(); + origPositioning = DOM.getStyleAttribute(contentEl, "position"); + DOM.setStyleAttribute(contentEl, "position", "absolute"); + } + DOM.setStyleAttribute(contentNode, "height", ""); + int availableH = DOM.getElementPropertyInt(getElement(), "clientHeight"); + + int usedH = DOM .getElementPropertyInt(bottomDecoration, + "offsetTop") + DOM.getElementPropertyInt(bottomDecoration, + "offsetHeight"); + int contentH = availableH - usedH - 1; if (contentH < 0) contentH = 0; DOM.setStyleAttribute(contentNode, "height", contentH + "px"); - /*if (hasChildren) { + if (hasChildren) { + ApplicationConnection.getConsole().log("positioning:" + origPositioning); DOM.setStyleAttribute(contentEl, "position", origPositioning); - }*/ + } DOM.setStyleAttribute(contentNode, "overflow", "auto"); } else { DOM.setStyleAttribute(contentNode, "height", ""); -- 2.39.5