9 * @class Roo.bootstrap.Navbar
10 * @extends Roo.bootstrap.Component
11 * Bootstrap Navbar class
12 * @cfg {Boolean} bar is a bar?
13 * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
14 * @cfg {String} brand what is brand
15 * @cfg {Boolean} inverse is inverted color
16 * @cfg {String} type (nav | pills | tabs)
17 * @cfg {Boolean} arrangement stacked | justified
18 * @cfg {String} align (left | right) alignment
19 * @cfg {String} brand_href href of the brand
20 * @cfg {Boolean} main (true|false) main nav bar? default false
21 * @cfg {Boolean} loadMask (true|false) loadMask on the bar
22 * @cfg {String} tag (header|footer|nav|div) default is nav
27 * @param {Object} config The config object
31 Roo.bootstrap.Navbar = function(config){
32 Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
36 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, {
54 getAutoCreate : function(){
71 this.type = this.type || 'nav';
72 if (['tabs','pills'].indexOf(this.type)!==-1) {
73 cfg.cn[0].cls += ' nav-' + this.type
75 if (this.type!=='nav') {
76 Roo.log('nav type must be nav/tabs/pills')
78 cfg.cn[0].cls += ' navbar-nav'
81 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
82 cfg.cn[0].cls += ' nav-' + this.arrangement;
86 if (this.align === 'right') {
87 cfg.cn[0].cls += ' navbar-right';
91 cfg.cls += ' navbar-inverse';
99 initEvents :function ()
101 //Roo.log(this.el.select('.navbar-toggle',true));
102 this.el.select('.navbar-toggle',true).on('click', function() {
104 this.el.select('.navbar-collapse',true).toggleClass('in');
112 this.maskEl = Roo.DomHelper.append(this.el, mark, true);
114 var size = this.el.getSize();
115 this.maskEl.setSize(size.width, size.height);
116 this.maskEl.enableDisplayMode("block");
125 getChildContainer : function()
127 if (this.bar === true) {
128 return this.el.select('.collapse',true).first();