major doc changes
[roojs1] / Roo / bootstrap / nav / Simplebar.js
1 /*
2  * - LGPL
3  *
4  * navbar
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.nav.Simplebar
10  * @extends Roo.bootstrap.nav.Bar
11  * @children Roo.bootstrap.nav.Group Roo.bootstrap.Container Roo.bootstrap.form.Form Roo.bootstrap.Row Roo.bootstrap.Column Roo.bootstrap.Link
12  * Bootstrap Sidebar class
13  *
14  * @cfg {Boolean} inverse is inverted color
15  * 
16  * @cfg {String} type (nav | pills | tabs)
17  * @cfg {Boolean} arrangement stacked | justified
18  * @cfg {String} align (left | right) alignment
19  * 
20  * @cfg {Boolean} main (true|false) main nav bar? default false
21  * @cfg {Boolean} loadMask (true|false) loadMask on the bar
22  * 
23  * @cfg {String} tag (header|footer|nav|div) default is nav 
24
25  * @cfg {String} weight (light|primary|secondary|success|danger|warning|info|dark|white) default is light.
26  * 
27  * 
28  * @constructor
29  * Create a new Sidebar
30  * @param {Object} config The config object
31  */
32
33
34 Roo.bootstrap.nav.Simplebar = function(config){
35     Roo.bootstrap.nav.Simplebar.superclass.constructor.call(this, config);
36 };
37
38 Roo.extend(Roo.bootstrap.nav.Simplebar, Roo.bootstrap.nav.Bar,  {
39     
40     inverse: false,
41     
42     type: false,
43     arrangement: '',
44     align : false,
45     
46     weight : 'light',
47     
48     main : false,
49     
50     
51     tag : false,
52     
53     
54     getAutoCreate : function(){
55         
56         
57         var cfg = {
58             tag : this.tag || 'div',
59             cls : 'navbar roo-navbar-simple' //navbar-expand-lg ??
60         };
61         if (['light','white'].indexOf(this.weight) > -1) {
62             cfg.cls += ['light','white'].indexOf(this.weight) > -1 ? ' navbar-light' : ' navbar-dark';
63         }
64         cfg.cls += ' bg-' + this.weight;
65         
66         if (this.inverse) {
67             cfg.cls += ' navbar-inverse';
68             
69         }
70         
71         // i'm not actually sure these are really used - normally we add a navGroup to a navbar
72         
73         if (Roo.bootstrap.version == 4 && this.xtype == 'NavSimplebar') {
74             return cfg;
75         }
76         
77         
78     
79         
80         cfg.cn = [
81             {
82                 cls: 'nav nav-' + this.xtype,
83                 tag : 'ul'
84             }
85         ];
86         
87          
88         this.type = this.type || 'nav';
89         if (['tabs','pills'].indexOf(this.type) != -1) {
90             cfg.cn[0].cls += ' nav-' + this.type
91         
92         
93         } else {
94             if (this.type!=='nav') {
95                 Roo.log('nav type must be nav/tabs/pills')
96             }
97             cfg.cn[0].cls += ' navbar-nav'
98         }
99         
100         
101         
102         
103         if (['stacked','justified'].indexOf(this.arrangement) != -1) {
104             cfg.cn[0].cls += ' nav-' + this.arrangement;
105         }
106         
107         
108         if (this.align === 'right') {
109             cfg.cn[0].cls += ' navbar-right';
110         }
111         
112         
113         
114         
115         return cfg;
116     
117         
118     }
119     
120     
121     
122 });
123
124
125
126  
127
128  
129