summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2008-03-11 15:13:42 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2008-03-11 15:13:42 +0000
commitc922ced08d1e5e36de4c3c6523bde9e429f8ebe8 (patch)
tree7ffb3f29e815a4408cb07529c93d535e2f044036 /src
parent8eb882a2d5e5b991d86c14dab724be1d65bfa2f1 (diff)
downloadvaadin-framework-c922ced08d1e5e36de4c3c6523bde9e429f8ebe8.tar.gz
vaadin-framework-c922ced08d1e5e36de4c3c6523bde9e429f8ebe8.zip
Fixes #1490
svn changeset:4027/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java17
1 files changed, 10 insertions, 7 deletions
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");