examples/bootstrap/right_sidebar.bjs
[roojs1] / Roo / bootstrap / dash / TabBox.js
1 /*
2  * - LGPL
3  *
4  * TabBox
5  * 
6  */
7 Roo.bootstrap.dash = Roo.bootstrap.dash || {};
8
9 /**
10  * @class Roo.bootstrap.dash.TabBox
11  * @extends Roo.bootstrap.Component
12  * Bootstrap TabBox class
13  * @cfg {String} title Title of the TabBox
14  * @cfg {String} icon Icon of the TabBox
15  * 
16  * @constructor
17  * Create a new TabBox
18  * @param {Object} config The config object
19  */
20
21
22 Roo.bootstrap.dash.TabBox = function(config){
23     Roo.bootstrap.dash.TabBox.superclass.constructor.call(this, config);
24     
25 };
26
27 Roo.extend(Roo.bootstrap.dash.TabBox, Roo.bootstrap.Component,  {
28
29     title : '',
30     icon : false,
31     
32     getChildContainer : function()
33     {
34         return this.el.select('.tab-content', true).first();
35     },
36     
37     getAutoCreate : function(){
38         
39         var header = {
40             tag: 'li',
41             cls: 'pull-left header',
42             html: this.title,
43             cn : []
44         };
45         
46         if(this.icon){
47             header.cn.push({
48                 tag: 'i',
49                 cls: 'fa ' + this.icon
50             });
51         }
52         
53         
54         var cfg = {
55             tag: 'div',
56             cls: 'nav-tabs-custom',
57             cn: [
58                 {
59                     tag: 'ul',
60                     cls: 'nav nav-tabs pull-right',
61                     cn: [
62                         header
63                     ]
64                 },
65                 {
66                     tag: 'div',
67                     cls: 'tab-content no-padding',
68                     cn: []
69                 }
70             ]
71         }
72
73         return  cfg;
74     }
75     
76 });
77
78