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(){
69 this.type = this.type || 'nav';
70 if (['tabs','pills'].indexOf(this.type)!==-1) {
71 cfg.cn[0].cls += ' nav-' + this.type
73 if (this.type!=='nav') {
74 Roo.log('nav type must be nav/tabs/pills')
76 cfg.cn[0].cls += ' navbar-nav'
79 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
80 cfg.cn[0].cls += ' nav-' + this.arrangement;
84 if (this.align === 'right') {
85 cfg.cn[0].cls += ' navbar-right';
89 cfg.cls += ' navbar-inverse';
97 initEvents :function ()
99 //Roo.log(this.el.select('.navbar-toggle',true));
100 this.el.select('.navbar-toggle',true).on('click', function() {
102 this.el.select('.navbar-collapse',true).toggleClass('in');
110 this.maskEl = Roo.DomHelper.append(this.el, mark, true);
112 var size = this.el.getSize();
113 this.maskEl.setSize(size.width, size.height);
114 this.maskEl.enableDisplayMode("block");
123 getChildContainer : function()
125 if (this.bar === true) {
126 return this.el.select('.collapse',true).first();