]> source.dussan.org Git - vaadin-framework.git/commitdiff
avoid small gap in form legend if no icon or caption
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 26 May 2008 09:17:41 +0000 (09:17 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 26 May 2008 09:17:41 +0000 (09:17 +0000)
svn changeset:4629/svn branch:trunk

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

index 3372f28eacc5c57b1976f49b20a93c668abd5e79..98d3ac7077413081ffc543f8326ae508370efa5f 100644 (file)
@@ -58,8 +58,10 @@ public class IForm extends ComplexPanel implements Paintable,
             return;\r
         }\r
 \r
+        boolean legendEmpty = true;\r
         if (uidl.hasAttribute("caption")) {\r
             DOM.setInnerText(caption, uidl.getStringAttribute("caption"));\r
+            legendEmpty = false;\r
         } else {\r
             DOM.setInnerText(caption, "");\r
         }\r
@@ -69,11 +71,17 @@ public class IForm extends ComplexPanel implements Paintable,
                 DOM.insertChild(legend, icon.getElement(), 0);\r
             }\r
             icon.setUri(uidl.getStringAttribute("icon"));\r
+            legendEmpty = false;\r
         } else {\r
             if (icon != null) {\r
                 DOM.removeChild(legend, icon.getElement());\r
             }\r
         }\r
+        if (legendEmpty) {\r
+            DOM.setStyleAttribute(legend, "display", "none");\r
+        } else {\r
+            DOM.setStyleAttribute(legend, "display", "");\r
+        }\r
 \r
         if (uidl.hasAttribute("error")) {\r
             final UIDL errorUidl = uidl.getErrors();\r