summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2008-05-26 09:17:41 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2008-05-26 09:17:41 +0000
commitdf54fe0c5315bc7ce08ec262094e4e099506cc25 (patch)
treebbc846105f825ad68027bfb48ab60acfb478cccc /src
parent4a9da77a329c1bd9cfee145971f06d0ca7d7dc15 (diff)
downloadvaadin-framework-df54fe0c5315bc7ce08ec262094e4e099506cc25.tar.gz
vaadin-framework-df54fe0c5315bc7ce08ec262094e4e099506cc25.zip
avoid small gap in form legend if no icon or caption
svn changeset:4629/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java8
1 files changed, 8 insertions, 0 deletions
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();