Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / examples / portal / classes / Portlet.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * @class Ext.app.Portlet
17  * @extends Ext.panel.Panel
18  * A {@link Ext.panel.Panel Panel} class that is managed by {@link Ext.app.PortalPanel}.
19  */
20 Ext.define('Ext.app.Portlet', {
21     extend: 'Ext.panel.Panel',
22     alias: 'widget.portlet',
23     layout: 'fit',
24     anchor: '100%',
25     frame: true,
26     closable: true,
27     collapsible: true,
28     animCollapse: true,
29     draggable: true,
30     cls: 'x-portlet',
31
32     // Override Panel's default doClose to provide a custom fade out effect
33     // when a portlet is removed from the portal
34     doClose: function() {
35         this.el.animate({
36             opacity: 0,
37             callback: function(){
38                 this.fireEvent('close', this);
39                 this[this.closeAction]();
40             },
41             scope: this
42         });
43     }
44 });