summaryrefslogtreecommitdiffstats
path: root/src/com/itmill
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-11-07 07:31:32 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-11-07 07:31:32 +0000
commit9da215a2e60aa77f752a92bc688c79207f9b799a (patch)
treeb6d7c4826b2129fe17d20ab916e41b96f4b37f08 /src/com/itmill
parent3b56a28bc754a3dddf1603f3194ce707c1aa1af4 (diff)
downloadvaadin-framework-9da215a2e60aa77f752a92bc688c79207f9b799a.tar.gz
vaadin-framework-9da215a2e60aa77f752a92bc688c79207f9b799a.zip
reverted back old layout function, new one didn't work with IE's
svn changeset:2725/svn branch:trunk
Diffstat (limited to 'src/com/itmill')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java41
1 files 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", "");