Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / source / widgets / layout / AccordionLayout.js
diff --git a/source/widgets/layout/AccordionLayout.js b/source/widgets/layout/AccordionLayout.js
deleted file mode 100644 (file)
index 906241e..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.layout.Accordion\r
- * @extends Ext.layout.FitLayout\r
- * <p>This is a layout that contains multiple panels in an expandable accordion style such that only one\r
- * panel can be open at any given time.  Each panel has built-in support for expanding and collapsing.\r
- * This class is intended to be extended or created via the layout:'accordion' {@link Ext.Container#layout}\r
- * config, and should generally not need to be created directly via the new keyword.</p>\r
- * <p>Note that when creating a layout via config, the layout-specific config properties must be passed in via\r
- * the {@link Ext.Container#layoutConfig} object which will then be applied internally to the layout.\r
- * Example usage:</p>\r
- * <pre><code>\r
-var accordion = new Ext.Panel({\r
-    title: 'Accordion Layout',\r
-    layout:'accordion',\r
-    defaults: {\r
-        // applied to each contained panel\r
-        bodyStyle: 'padding:15px'\r
-    },\r
-    layoutConfig: {\r
-        // layout-specific configs go here\r
-        titleCollapse: false,\r
-        animate: true,\r
-        activeOnTop: true\r
-    },\r
-    items: [{\r
-        title: 'Panel 1',\r
-        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
-    },{\r
-        title: 'Panel 2',\r
-        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
-    },{\r
-        title: 'Panel 3',\r
-        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
-    }]\r
-});\r
-</code></pre>\r
- */\r
-Ext.layout.Accordion = Ext.extend(Ext.layout.FitLayout, {\r
-    /**\r
-     * @cfg {Boolean} fill\r
-     * True to adjust the active item's height to fill the available space in the container, false to use the\r
-     * item's current height, or auto height if not explicitly set (defaults to true).\r
-     */\r
-    fill : true,\r
-    /**\r
-     * @cfg {Boolean} autoWidth\r
-     * True to set each contained item's width to 'auto', false to use the item's current width (defaults to true).\r
-     * Note that some components, in particular the {@link Ext.grid.GridPanel grid}, will not function properly within\r
-     * layouts if they have auto width, so in such cases this config should be set to false.\r
-     */\r
-    autoWidth : true,\r
-    /**\r
-     * @cfg {Boolean} titleCollapse\r
-     * True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow\r
-     * expand/collapse only when the toggle tool button is clicked (defaults to true).  When set to false,\r
-     * {@link #hideCollapseTool} should be false also.\r
-     */\r
-    titleCollapse : true,\r
-    /**\r
-     * @cfg {Boolean} hideCollapseTool\r
-     * True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false).\r
-     * When set to true, {@link #titleCollapse} should be true also.\r
-     */\r
-    hideCollapseTool : false,\r
-    /**\r
-     * @cfg {Boolean} collapseFirst\r
-     * True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools\r
-     * in the contained panels' title bars, false to render it last (defaults to false).\r
-     */\r
-    collapseFirst : false,\r
-    /**\r
-     * @cfg {Boolean} animate\r
-     * True to slide the contained panels open and closed during expand/collapse using animation, false to open and\r
-     * close directly with no animation (defaults to false).  Note: to defer to the specific config setting of each\r
-     * contained panel for this property, set this to undefined at the layout level.\r
-     */\r
-    animate : false,\r
-    /**\r
-     * @cfg {Boolean} sequence\r
-     * <b>Experimental</b>. If animate is set to true, this will result in each animation running in sequence.\r
-     */\r
-    sequence : false,\r
-    /**\r
-     * @cfg {Boolean} activeOnTop\r
-     * True to swap the position of each panel as it is expanded so that it becomes the first item in the container,\r
-     * false to keep the panels in the rendered order. <b>This is NOT compatible with "animate:true"</b> (defaults to false).\r
-     */\r
-    activeOnTop : false,\r
-\r
-    renderItem : function(c){\r
-        if(this.animate === false){\r
-            c.animCollapse = false;\r
-        }\r
-        c.collapsible = true;\r
-        if(this.autoWidth){\r
-            c.autoWidth = true;\r
-        }\r
-        if(this.titleCollapse){\r
-            c.titleCollapse = true;\r
-        }\r
-        if(this.hideCollapseTool){\r
-            c.hideCollapseTool = true;\r
-        }\r
-        if(this.collapseFirst !== undefined){\r
-            c.collapseFirst = this.collapseFirst;\r
-        }\r
-        if(!this.activeItem && !c.collapsed){\r
-            this.activeItem = c;\r
-        }else if(this.activeItem){\r
-            c.collapsed = true;\r
-        }\r
-        Ext.layout.Accordion.superclass.renderItem.apply(this, arguments);\r
-        c.header.addClass('x-accordion-hd');\r
-        c.on('beforeexpand', this.beforeExpand, this);\r
-    },\r
-\r
-    // private\r
-    beforeExpand : function(p, anim){\r
-        var ai = this.activeItem;\r
-        if(ai){\r
-            if(this.sequence){\r
-                delete this.activeItem;\r
-                if (!ai.collapsed){\r
-                    ai.collapse({callback:function(){\r
-                        p.expand(anim || true);\r
-                    }, scope: this});\r
-                    return false;\r
-                }\r
-            }else{\r
-                ai.collapse(this.animate);\r
-            }\r
-        }\r
-        this.activeItem = p;\r
-        if(this.activeOnTop){\r
-            p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild);\r
-        }\r
-        this.layout();\r
-    },\r
-\r
-    // private\r
-    setItemSize : function(item, size){\r
-        if(this.fill && item){\r
-            var items = this.container.items.items;\r
-            var hh = 0;\r
-            for(var i = 0, len = items.length; i < len; i++){\r
-                var p = items[i];\r
-                if(p != item){\r
-                    hh += (p.getSize().height - p.bwrap.getHeight());\r
-                }\r
-            }\r
-            size.height -= hh;\r
-            item.setSize(size);\r
-        }\r
-    }\r
-});\r
-Ext.Container.LAYOUTS['accordion'] = Ext.layout.Accordion;
\ No newline at end of file