Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / examples / panel / bubble-panel / bubble-panel.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 Ext.require([
16     'Ext.panel.*'
17 ]);
18
19 Ext.onReady(function() {
20     Ext.create('widget.button', {
21         renderTo: 'button',
22         
23         text: 'Toggle UI: default-framed',
24         handler: function() {
25             var panel = Ext.getCmp('ui-panel'),
26                 uis = ['default-framed', 'bubble'],
27                 index = Ext.Array.indexOf(uis, panel.ui);
28             
29             if ((index + 1) >= uis.length) {
30                 panel.setUI(uis[0]);
31             } else {
32                 panel.setUI(uis[index + 1]);
33             }
34             
35             panel.doLayout();
36             
37             this.setText('Toggle UI: ' + panel.ui);
38         }
39     })
40     
41     // Normal panel
42     Ext.create('widget.panel', {
43         id: 'ui-panel',
44         
45         renderTo: 'panelCt',
46         
47         title: 'Plain Old Panel',
48         width: 400,
49         autoHeight: true,
50         frame: true,
51         
52         contentEl: 'bubble-markup',
53         
54         html: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br /><br />Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.'
55     });
56 });
57