summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-03-30 16:02:05 +0300
committerVaadin Code Review <review@vaadin.com>2015-05-15 11:01:57 +0000
commit3a5cd8e4cd36a9db986978c01fe39356b3cbe3b6 (patch)
tree5b0635a43e566aec92b76c668e65cdf8091ce1ce /client
parentfaeabd74d878d7bcf9ede6034ef497c59196e658 (diff)
downloadvaadin-framework-3a5cd8e4cd36a9db986978c01fe39356b3cbe3b6.tar.gz
vaadin-framework-3a5cd8e4cd36a9db986978c01fe39356b3cbe3b6.zip
Make FormLayout work with HTML captions (#17143)
Change-Id: I334441fd2f8d5f6d9e0629f5d7b564e9008f3fe5
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VFormLayout.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/client/src/com/vaadin/client/ui/VFormLayout.java b/client/src/com/vaadin/client/ui/VFormLayout.java
index 3781305e52..42dbbde32a 100644
--- a/client/src/com/vaadin/client/ui/VFormLayout.java
+++ b/client/src/com/vaadin/client/ui/VFormLayout.java
@@ -223,7 +223,7 @@ public class VFormLayout extends SimplePanel {
private Icon icon;
- private Element captionText;
+ private Element captionContent;
/**
*
@@ -274,13 +274,13 @@ public class VFormLayout extends SimplePanel {
}
if (state.caption != null) {
- if (captionText == null) {
- captionText = DOM.createSpan();
+ if (captionContent == null) {
+ captionContent = DOM.createSpan();
- AriaHelper.bindCaption(owner.getWidget(), captionText);
+ AriaHelper.bindCaption(owner.getWidget(), captionContent);
- DOM.insertChild(getElement(), captionText, icon == null ? 0
- : 1);
+ DOM.insertChild(getElement(), captionContent,
+ icon == null ? 0 : 1);
}
String c = state.caption;
if (c == null) {
@@ -288,12 +288,16 @@ public class VFormLayout extends SimplePanel {
} else {
isEmpty = false;
}
- DOM.setInnerText(captionText, c);
+ if (state.captionAsHtml) {
+ captionContent.setInnerHTML(c);
+ } else {
+ captionContent.setInnerText(c);
+ }
} else {
// TODO should span also be removed
}
- if (state.description != null && captionText != null) {
+ if (state.description != null && captionContent != null) {
addStyleDependentName("hasdescription");
} else {
removeStyleDependentName("hasdescription");