From: Matti Tahvonen Date: Tue, 11 Mar 2008 15:13:42 +0000 (+0000) Subject: Fixes #1490 X-Git-Tag: 6.7.0.beta1~4943 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c922ced08d1e5e36de4c3c6523bde9e429f8ebe8;p=vaadin-framework.git Fixes #1490 svn changeset:4027/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java index d7372e6f56..fa58eb3fcc 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java @@ -56,10 +56,6 @@ public class IAccordion extends ITabsheetBase implements // TODO check indexes, now new tabs get placed last (changing tab order // is not supported from server-side) StackItem item = new StackItem(caption); - if (selected) { - item.setContent(contentUidl); - item.open(); - } if (stack.size() == 0) { item.addStyleDependentName("first"); @@ -67,15 +63,20 @@ public class IAccordion extends ITabsheetBase implements stack.add(item); add(item); + + if (selected) { + item.open(); + item.setContent(contentUidl); + } } protected void selectTab(final int index, final UIDL contentUidl) { if (index != activeTabIndex) { activeTabIndex = index; StackItem item = (StackItem) stack.get(index); - item.setContent(contentUidl); item.open(); iLayout(); + item.setContent(contentUidl); } } @@ -111,8 +112,9 @@ public class IAccordion extends ITabsheetBase implements public void iLayout() { StackItem item = getSelectedStack(); - if (item == null) + if (item == null) { return; + } if (height != null && height != "") { // Detach visible widget from document flow for a while to calculate @@ -137,8 +139,9 @@ public class IAccordion extends ITabsheetBase implements int usedHeight = getOffsetHeight(); int h = targetHeight - usedHeight; - if (h < 0) + if (h < 0) { h = 0; + } DOM.setStyleAttribute(item.getContainerElement(), "height", h + "px");