Roo/bootstrap/dash/TabPane.js
[roojs1] / Roo / bootstrap / dash / TabPane.js
1 /*
2  * - LGPL
3  *
4  * Tab pane
5  * 
6  */
7 Roo.bootstrap.dash = Roo.bootstrap.dash || {};
8 /**
9  * @class Roo.bootstrap.TabPane
10  * @extends Roo.bootstrap.Component
11  * Bootstrap TabPane class
12  * @cfg {Boolean} active (false | true) Default false
13
14  * 
15  * @constructor
16  * Create a new TabPane
17  * @param {Object} config The config object
18  */
19
20 Roo.bootstrap.dash.TabPane = function(config){
21     Roo.bootstrap.dash.TabPane.superclass.constructor.call(this, config);
22     
23 };
24
25 Roo.extend(Roo.bootstrap.dash.TabPane, Roo.bootstrap.Component,  {
26     
27     active : false,
28     
29     getBox : function()
30     {
31         return this.el.findParent('.nav-tabs-custom', false, true);
32     },
33     
34     getChildContainer : function()
35     {
36         return this.getBox().select('.tab-content', true).first();
37     },
38     
39     getAutoCreate : function() 
40     {
41         var cfg = {
42             tag: 'div',
43             cls: 'tab-pane'
44         }
45         
46         if(this.active){
47             cfg.cls += ' active';
48         }
49         
50         return cfg;
51     }
52     
53     
54 });
55
56  
57
58
59