From: Matti Tahvonen Date: Mon, 26 May 2008 09:17:41 +0000 (+0000) Subject: avoid small gap in form legend if no icon or caption X-Git-Tag: 6.7.0.beta1~4704 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=df54fe0c5315bc7ce08ec262094e4e099506cc25;p=vaadin-framework.git avoid small gap in form legend if no icon or caption svn changeset:4629/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java index 3372f28eac..98d3ac7077 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java @@ -58,8 +58,10 @@ public class IForm extends ComplexPanel implements Paintable, return; } + boolean legendEmpty = true; if (uidl.hasAttribute("caption")) { DOM.setInnerText(caption, uidl.getStringAttribute("caption")); + legendEmpty = false; } else { DOM.setInnerText(caption, ""); } @@ -69,11 +71,17 @@ public class IForm extends ComplexPanel implements Paintable, DOM.insertChild(legend, icon.getElement(), 0); } icon.setUri(uidl.getStringAttribute("icon")); + legendEmpty = false; } else { if (icon != null) { DOM.removeChild(legend, icon.getElement()); } } + if (legendEmpty) { + DOM.setStyleAttribute(legend, "display", "none"); + } else { + DOM.setStyleAttribute(legend, "display", ""); + } if (uidl.hasAttribute("error")) { final UIDL errorUidl = uidl.getErrors();