diff options
author | Marc Englund <marc@vaadin.com> | 2012-10-12 11:58:47 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-10-12 11:58:47 +0000 |
commit | 29d1b00aa5cfa81a9a945e492ac408554c100ab8 (patch) | |
tree | e17d121c1d6a31698e3ea49fc8ab6b06563fc088 /client | |
parent | 316e99e47b20951c187cd4ff2220c0c7e3be24cf (diff) | |
parent | f2d4abba38a8d9d3bfea780254c3f65f030f7a17 (diff) | |
download | vaadin-framework-29d1b00aa5cfa81a9a945e492ac408554c100ab8.tar.gz vaadin-framework-29d1b00aa5cfa81a9a945e492ac408554c100ab8.zip |
Merge "Fixed primary stylename handling for CustomLayout #9902"
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/customlayout/VCustomLayout.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/ui/customlayout/VCustomLayout.java b/client/src/com/vaadin/client/ui/customlayout/VCustomLayout.java index 7a512fac49..803b266550 100644 --- a/client/src/com/vaadin/client/ui/customlayout/VCustomLayout.java +++ b/client/src/com/vaadin/client/ui/customlayout/VCustomLayout.java @@ -21,6 +21,10 @@ import java.util.Iterator; import com.google.gwt.dom.client.ImageElement; import com.google.gwt.dom.client.NodeList; +import com.google.gwt.dom.client.Style; +import com.google.gwt.dom.client.Style.BorderStyle; +import com.google.gwt.dom.client.Style.Position; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; @@ -75,16 +79,22 @@ public class VCustomLayout extends ComplexPanel { public VCustomLayout() { setElement(DOM.createDiv()); // Clear any unwanted styling - DOM.setStyleAttribute(getElement(), "border", "none"); - DOM.setStyleAttribute(getElement(), "margin", "0"); - DOM.setStyleAttribute(getElement(), "padding", "0"); + Style style = getElement().getStyle(); + style.setBorderStyle(BorderStyle.NONE); + style.setMargin(0, Unit.PX); + style.setPadding(0, Unit.PX); if (BrowserInfo.get().isIE()) { - DOM.setStyleAttribute(getElement(), "position", "relative"); + style.setPosition(Position.RELATIVE); } - setStyleName(StyleConstants.UI_LAYOUT); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + } + + @Override + public void setStyleName(String style) { + super.setStyleName(style); + addStyleName(StyleConstants.UI_LAYOUT); } /** |