summaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-10-10 17:46:57 +0300
committerJohn Ahlroos <john@vaadin.com>2012-10-10 17:46:57 +0300
commitf5043ac109b73c1a01e1caa8dc7906d864ad8833 (patch)
tree951ef281bb76d4e1e71e8b1105279aeb28f67a21 /client/src
parent282df27379d251aea4c9ec5e15e179070a8e7633 (diff)
downloadvaadin-framework-f5043ac109b73c1a01e1caa8dc7906d864ad8833.tar.gz
vaadin-framework-f5043ac109b73c1a01e1caa8dc7906d864ad8833.zip
Fixed primary stylename handling in Accordion #9900
Change-Id: Iab4e8c8d0a0c98b770b7970fd1c099698e6a6531
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/ui/accordion/VAccordion.java34
1 files changed, 31 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ui/accordion/VAccordion.java b/client/src/com/vaadin/client/ui/accordion/VAccordion.java
index e906cf3cce..0fbbcf5780 100644
--- a/client/src/com/vaadin/client/ui/accordion/VAccordion.java
+++ b/client/src/com/vaadin/client/ui/accordion/VAccordion.java
@@ -87,6 +87,26 @@ public class VAccordion extends VTabsheetBase {
}
}
+ @Override
+ public void setStylePrimaryName(String style) {
+ updateStyleNames(style);
+ }
+
+ @Override
+ public void setStyleName(String style) {
+ updateStyleNames(style);
+ }
+
+ protected void updateStyleNames(String primaryStyleName) {
+ super.setStyleName(primaryStyleName);
+ for (Widget w : getChildren()) {
+ if (w instanceof StackItem) {
+ StackItem item = (StackItem) w;
+ item.updateStyleNames(primaryStyleName);
+ }
+ }
+ }
+
/**
* This method tries to find out if a tab has been rendered with a different
* index previously. If this is the case it re-orders the children so the
@@ -359,15 +379,23 @@ public class VAccordion extends VTabsheetBase {
DOM.appendChild(getElement(), captionNode);
DOM.appendChild(getElement(), content);
- getElement().addClassName(CLASSNAME + "-item");
- captionNode.addClassName(CLASSNAME + "-item-caption");
- content.addClassName(CLASSNAME + "-item-content");
+ updateStyleNames(VAccordion.this.getStylePrimaryName());
touchScrollHandler.addElement(getContainerElement());
close();
}
+ private void updateStyleNames(String primaryStyleName) {
+ content.removeClassName(getStylePrimaryName() + "-content");
+ captionNode.removeClassName(getStylePrimaryName() + "-caption");
+
+ setStylePrimaryName(primaryStyleName + "-item");
+
+ captionNode.addClassName(getStylePrimaryName() + "-caption");
+ content.addClassName(getStylePrimaryName() + "-content");
+ }
+
@Override
public void onBrowserEvent(Event event) {
onSelectTab(this);