/*!
- * Ext JS Library 3.0.3
+ * Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
c.collapseFirst = this.collapseFirst;\r
}\r
if(!this.activeItem && !c.collapsed){\r
- this.activeItem = c;\r
+ this.setActiveItem(c, true);\r
}else if(this.activeItem && this.activeItem != c){\r
c.collapsed = true;\r
}\r
ai.collapse(this.animate);\r
}\r
}\r
- this.activeItem = p;\r
+ this.setActive(p);\r
if(this.activeOnTop){\r
p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild);\r
}\r
* @param {String/Number} item The string component id or numeric index of the item to activate\r
*/\r
setActiveItem : function(item){\r
+ this.setActive(item, true);\r
+ },\r
+ \r
+ // private\r
+ setActive : function(item, expand){\r
+ var ai = this.activeItem;\r
item = this.container.getComponent(item);\r
- if(this.activeItem != item){\r
- if(item.rendered && item.collapsed){\r
+ if(ai != item){\r
+ if(item.rendered && item.collapsed && expand){\r
item.expand();\r
}else{\r
+ if(ai){\r
+ ai.fireEvent('deactivate', ai);\r
+ }\r
this.activeItem = item;\r
+ item.fireEvent('activate', item);\r
}\r
}\r
-\r
}\r
});\r
Ext.Container.LAYOUTS.accordion = Ext.layout.AccordionLayout;\r