9 * @class Roo.bootstrap.NavHeaderbar
10 * @extends Roo.bootstrap.NavSimplebar
11 * Bootstrap Sidebar class
13 * @cfg {String} brand what is brand
14 * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
15 * @cfg {String} brand_href href of the brand
16 * @cfg {Boolean} srButton generate the (screen reader / mobile) sr-only button default true
17 * @cfg {Boolean} autohide a top nav bar header that hides on scroll.
18 * @cfg {Boolean} desktopCenter should the header be centered on desktop using a container class
19 * @cfg {Roo.bootstrap.Row} mobilerow - a row to display on mobile only..
22 * Create a new Sidebar
23 * @param {Object} config The config object
27 Roo.bootstrap.NavHeaderbar = function(config){
28 Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this, config);
32 Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar, {
39 desktopCenter : false,
42 getAutoCreate : function(){
45 tag: this.nav || 'nav',
52 if (this.desktopCenter) {
53 cn.push({cls : 'container', cn : []});
66 'data-toggle': 'collapse',
71 html: 'Toggle navigation'
93 cls: 'collapse navbar-collapse',
97 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
99 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
100 cfg.cls += ' navbar-' + this.position;
102 // tag can override this..
104 cfg.tag = this.tag || (this.position == 'fixed-bottom' ? 'footer' : 'header');
107 if (this.brand !== '') {
110 href: this.brand_href ? this.brand_href : '#',
119 cfg.cls += ' main-nav';
127 getHeaderChildContainer : function()
129 if (this.el.select('.navbar-header').getCount()) {
130 return this.el.select('.navbar-header',true).first();
133 return this.getChildContainer();
137 initEvents : function()
139 Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);
146 Roo.get(document).on('scroll',function(e) {
147 var ns = Roo.get(document).getScroll().top;
152 ft.removeClass('slideDown');
153 ft.addClass('slideUp');
156 ft.removeClass('slideUp');
157 ft.addClass('slideDown');