extend: 'Ext.layout.container.VBox',
alias: ['layout.accordion'],
alternateClassName: 'Ext.layout.AccordionLayout',
-
+
align: 'stretch',
<span id='Ext-layout-container-Accordion-cfg-fill'> /**
me.callParent(arguments);
if (me.fill) {
- if (!me.owner.el.dom.style.height) {
+ if (!me.owner.el.dom.style.height || !me.getLayoutTargetSize().height) {
return false;
}
} else {
delete comp.hideHeader;
comp.collapsible = true;
comp.title = comp.title || '&#160;';
- comp.setBorder(false);
// Set initial sizes
comp.width = targetSize.width;
comp.collapsed = true;
}
// Otherwise expand the first item with collapsed explicitly configured as false
- else if (comp.collapsed === false) {
+ else if (comp.hasOwnProperty('collapsed') && comp.collapsed === false) {
comp.flex = 1;
me.expandedItem = i;
} else {
comp.collapsed = true;
}
+ // If we are fitting, then intercept expand/collapse requests.
+ me.owner.mon(comp, {
+ show: me.onComponentShow,
+ beforeexpand: me.onComponentExpand,
+ beforecollapse: me.onComponentCollapse,
+ scope: me
+ });
} else {
delete comp.flex;
comp.animCollapse = me.initialAnimate;
comp.flex = 1;
}
}
-
+
// Render all Panels.
me.callParent(arguments);
-
+
// Postprocess rendered Panels.
ln = renderedPanels.length;
for (i = 0; i < ln; i++) {
comp.header.addCls(Ext.baseCSSPrefix + 'accordion-hd');
comp.body.addCls(Ext.baseCSSPrefix + 'accordion-body');
-
- // If we are fitting, then intercept expand/collapse requests.
- if (me.fill) {
- me.owner.mon(comp, {
- show: me.onComponentShow,
- beforeexpand: me.onComponentExpand,
- beforecollapse: me.onComponentCollapse,
- scope: me
- });
- }
}
},
onLayout: function() {
var me = this;
-
- me.updatePanelClasses();
-
+
+
if (me.fill) {
me.callParent(arguments);
} else {
}
}
}
-
+ me.updatePanelClasses();
+
return me;
},
-
+
updatePanelClasses: function() {
var children = this.getLayoutItems(),
ln = children.length,
siblingCollapsed = true,
i, child;
-
+
for (i = 0; i < ln; i++) {
child = children[i];
- if (!siblingCollapsed) {
- child.header.addCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
+
+ if (siblingCollapsed) {
+ child.header.removeCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
}
else {
- child.header.removeCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
+ child.header.addCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
}
+
if (i + 1 == ln && child.collapsed) {
child.header.addCls(Ext.baseCSSPrefix + 'accordion-hd-last-collapsed');
}
me.setCollapsed(comp);
}
}
-
+
me.animate = me.initialAnimate;
me.layout();
me.animate = false;
if (expanded.length === 1 && expanded[0] === comp) {
me.setExpanded(toExpand);
}
-
+
me.animate = me.initialAnimate;
me.layout();
me.animate = false;