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(){
72 this.type = this.type || 'nav';
73 if (['tabs','pills'].indexOf(this.type)!==-1) {
74 cfg.cn[0].cls += ' nav-' + this.type
76 if (this.type!=='nav') {
77 Roo.log('nav type must be nav/tabs/pills')
79 cfg.cn[0].cls += ' navbar-nav'
82 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
83 cfg.cn[0].cls += ' nav-' + this.arrangement;
87 if (this.align === 'right') {
88 cfg.cn[0].cls += ' navbar-right';
92 cfg.cls += ' navbar-inverse';
100 initEvents :function ()
102 //Roo.log(this.el.select('.navbar-toggle',true));
103 this.el.select('.navbar-toggle',true).on('click', function() {
105 this.el.select('.navbar-collapse',true).toggleClass('in');
113 this.maskEl = Roo.DomHelper.append(this.el, mark, true);
115 var size = this.el.getSize();
116 this.maskEl.setSize(size.width, size.height);
117 this.maskEl.enableDisplayMode("block");
126 getChildContainer : function()
128 if (this.bar === true) {
129 return this.el.select('.collapse',true).first();