]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #1910 IOrderedLayout should adapt to content width when in horizontal mode...
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Fri, 4 Jul 2008 11:34:45 +0000 (11:34 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Fri, 4 Jul 2008 11:34:45 +0000 (11:34 +0000)
svn changeset:5060/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java

index c0b39c53b27f4822c26f71d9df9d9988fcc6a271..b38927ed92ccfb6a20e2bb0ca752c1d2615aca0a 100644 (file)
@@ -121,7 +121,6 @@ public class IOrderedLayout extends Panel implements Container,
         root = DOM.createDiv();
         margin = DOM.createDiv();
         DOM.appendChild(root, margin);
-        DOM.setStyleAttribute(margin, "overflow", "hidden");
         createAndEmptyWrappedChildContainer();
         setElement(root);
         setStyleName(CLASSNAME);
@@ -137,9 +136,13 @@ public class IOrderedLayout extends Panel implements Container,
             DOM.setInnerHTML(margin, structure);
             wrappedChildContainer = DOM.getFirstChild(DOM.getFirstChild(DOM
                     .getFirstChild(margin)));
+            DOM.setStyleAttribute(root, "display", "table");
+            DOM.setStyleAttribute(margin, "display", "table");
         } else {
             wrappedChildContainer = margin;
             DOM.setInnerHTML(margin, "");
+            DOM.setStyleAttribute(root, "display", "block");
+            DOM.setStyleAttribute(margin, "display", "block");
         }
     }
 
@@ -339,6 +342,7 @@ public class IOrderedLayout extends Panel implements Container,
 
         if (width == null || "".equals(width)) {
             DOM.setStyleAttribute(margin, "width", "");
+            DOM.setStyleAttribute(margin, "overflowX", "");
 
             if (fixedCellSize && orientationMode == ORIENTATION_HORIZONTAL) {
                 removeFixedSizes();
@@ -350,6 +354,7 @@ public class IOrderedLayout extends Panel implements Container,
             cw -= margins.hasLeft() ? marginLeft : 0;
             cw -= margins.hasRight() ? marginRight : 0;
             DOM.setStyleAttribute(margin, "width", cw + "px");
+            DOM.setStyleAttribute(margin, "overflowX", "hidden");
 
             if (orientationMode == ORIENTATION_HORIZONTAL) {
                 fixedCellSize = true;
@@ -369,6 +374,7 @@ public class IOrderedLayout extends Panel implements Container,
 
         if (height == null || "".equals(height)) {
             DOM.setStyleAttribute(margin, "height", "");
+            DOM.setStyleAttribute(margin, "overflowY", "");
 
             // Removing fixed size is needed only when it is in use
             if (fixedCellSize && orientationMode == ORIENTATION_VERTICAL) {
@@ -381,6 +387,7 @@ public class IOrderedLayout extends Panel implements Container,
             ch -= margins.hasTop() ? marginTop : 0;
             ch -= margins.hasBottom() ? marginBottom : 0;
             DOM.setStyleAttribute(margin, "height", ch + "px");
+            DOM.setStyleAttribute(margin, "overflowY", "hidden");
 
             // Turn on vertical orientation mode if needed
             if (orientationMode == ORIENTATION_VERTICAL) {