Fixed the autofocus on currently selected accordion tab.
[htsworkflow.git] / www / js / htsw.js
1
2 $(document).ready(function(){
3     var menuAccordionPanel = new Ext.Panel({
4         id: 'menu_accordion',
5         flex: 1,
6         layout: 'accordion',
7         layoutConfig: {
8             animate: true,
9             fill: true
10         },
11         items: [{
12             title: 'Freezers',
13             id: 'freezers_menu_panel',
14             contentEl: 'freezer_menu'
15         },{
16             title: 'Containers',
17             id: 'containers_menu_panel',
18             contentEl: 'container_menu'
19         },{
20             title: 'Samples',
21             id: 'samples_menu_panel',
22             contentEl: 'sample_menu'
23         },{
24             title: 'Settings',
25             id: 'settings_menu_panel',
26             contentEl: 'settings_menu'
27         }]
28     });
29     
30     var mainBorderPanel = new Ext.Viewport({
31        layout: 'border',
32        items: [{
33             region: 'north',
34             layout: 'vBox',
35             layoutConfig: {
36                 align: 'stretch',
37                 pack: 'start'
38             },
39             items: [{
40                     xtype: 'box',
41                     applyTo: 'header',
42                     id: 'header-panel',
43                     height: 30
44                 },{
45                     xtype: 'toolbar',
46                     //height: 100,
47                     items: [{
48                         text: "Button"
49                     }],
50                     margins: '2 0 0 0'
51             }],
52             height: 60 
53        },{
54             title: 'Menu',
55             region: 'west',
56             margins: '2 0 0 0',
57             width: 200,
58             collapsible: true,
59             cmargins: '2 2 0 2',
60             id: 'menu-panel',
61             layout: 'vBox',
62             layoutConfig: {
63                 align: 'stretch',
64                 pack: 'start'
65             },
66             items: [
67                     menuAccordionPanel,
68                 {
69                     xtype: 'box',
70                     applyTo: 'bcmagic_div',
71                     height: 200
72                 }]
73             
74             //unstyled: true
75        },{
76             title: 'Body',
77             region: 'center',
78             xtype: 'container',
79             layout: 'fit',
80             margins: '2 2 2 2',
81             items: {
82                 //title: 'Inner Panel',
83                 contentEl: 'body_content',
84                 border: true
85             }
86        }]
87     });
88     
89     /*
90     Ext.MessageBox.show({
91         title: 'Debug',
92         msg: 'menuAccordionPanel id: ' + menuAccordionPanel.getItemId(),
93         buttons: Ext.MessageBox.OK,
94         icon: Ext.MessageBox.INFO
95     })
96     */
97     
98 });