diff options
author | Denis Anisimov <denis@vaadin.com> | 2014-03-13 08:56:31 +0200 |
---|---|---|
committer | Denis Anisimov <denis@vaadin.com> | 2014-04-30 12:58:06 +0000 |
commit | c98286e22c32b56a75b21d629c8b5968856d1ae1 (patch) | |
tree | a22601f58aeb495c8a091602bda84023de4679c2 /client | |
parent | 16bcacd5eb5d56491b4fb4777bab950880b644f3 (diff) | |
download | vaadin-framework-c98286e22c32b56a75b21d629c8b5968856d1ae1.tar.gz vaadin-framework-c98286e22c32b56a75b21d629c8b5968856d1ae1.zip |
Set explicit left alignment instead of removing text-align style (#13399).
Change-Id: I3407555739ff443055e2e61aa14327d44a65cd8e
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 38f8ff8644..b0cd614e42 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -3843,7 +3843,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, "right"); break; default: - DOM.setStyleAttribute(captionContainer, "textAlign", ""); + DOM.setStyleAttribute(captionContainer, "textAlign", "left"); break; } } @@ -5407,17 +5407,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } else { container.setInnerText(text); } - if (align != ALIGN_LEFT) { - switch (align) { - case ALIGN_CENTER: - container.getStyle().setProperty("textAlign", "center"); - break; - case ALIGN_RIGHT: - default: - container.getStyle().setProperty("textAlign", "right"); - break; - } - } + setAlign(align, container); setTooltip(td, description); td.appendChild(container); @@ -5455,6 +5445,21 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } + private void setAlign(char align, final Element container) { + switch (align) { + case ALIGN_CENTER: + container.getStyle().setProperty("textAlign", "center"); + break; + case ALIGN_LEFT: + container.getStyle().setProperty("textAlign", "left"); + break; + case ALIGN_RIGHT: + default: + container.getStyle().setProperty("textAlign", "right"); + break; + } + } + protected void initCellWithWidget(Widget w, char align, String style, boolean sorted, final TableCellElement td) { final Element container = DOM.createDiv(); @@ -5471,21 +5476,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, td.setClassName(className); container.setClassName(VScrollTable.this.getStylePrimaryName() + "-cell-wrapper"); - // TODO most components work with this, but not all (e.g. - // Select) - // Old comment: make widget cells respect align. - // text-align:center for IE, margin: auto for others - if (align != ALIGN_LEFT) { - switch (align) { - case ALIGN_CENTER: - container.getStyle().setProperty("textAlign", "center"); - break; - case ALIGN_RIGHT: - default: - container.getStyle().setProperty("textAlign", "right"); - break; - } - } + setAlign(align, container); td.appendChild(container); getElement().appendChild(td); // ensure widget not attached to another element (possible tBody |