X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Accordion.html diff --git a/docs/source/Accordion.html b/docs/source/Accordion.html index 61cebadd..0c3ce448 100644 --- a/docs/source/Accordion.html +++ b/docs/source/Accordion.html @@ -57,7 +57,7 @@ Ext.define('Ext.layout.container.Accordion', { extend: 'Ext.layout.container.VBox', alias: ['layout.accordion'], alternateClassName: 'Ext.layout.AccordionLayout', - + align: 'stretch', /** @@ -135,7 +135,7 @@ Ext.define('Ext.layout.container.Accordion', { 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 { @@ -174,7 +174,6 @@ Ext.define('Ext.layout.container.Accordion', { delete comp.hideHeader; comp.collapsible = true; comp.title = comp.title || '&#160;'; - comp.setBorder(false); // Set initial sizes comp.width = targetSize.width; @@ -187,12 +186,19 @@ Ext.define('Ext.layout.container.Accordion', { 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; @@ -211,10 +217,10 @@ Ext.define('Ext.layout.container.Accordion', { comp.flex = 1; } } - + // Render all Panels. me.callParent(arguments); - + // Postprocess rendered Panels. ln = renderedPanels.length; for (i = 0; i < ln; i++) { @@ -225,24 +231,13 @@ Ext.define('Ext.layout.container.Accordion', { 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 { @@ -260,24 +255,27 @@ Ext.define('Ext.layout.container.Accordion', { } } } - + 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'); } @@ -306,7 +304,7 @@ Ext.define('Ext.layout.container.Accordion', { me.setCollapsed(comp); } } - + me.animate = me.initialAnimate; me.layout(); me.animate = false; @@ -328,7 +326,7 @@ Ext.define('Ext.layout.container.Accordion', { if (expanded.length === 1 && expanded[0] === comp) { me.setExpanded(toExpand); } - + me.animate = me.initialAnimate; me.layout(); me.animate = false;