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 {Roo.bootstrap.Row} mobilerow - a row to display on mobile only..
21 * Create a new Sidebar
22 * @param {Object} config The config object
26 Roo.bootstrap.NavHeaderbar = function(config){
27 Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this, config);
31 Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar, {
40 getAutoCreate : function(){
43 tag: this.nav || 'nav',
58 'data-toggle': 'collapse',
63 html: 'Toggle navigation'
85 cls: 'collapse navbar-collapse',
89 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
91 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
92 cfg.cls += ' navbar-' + this.position;
94 // tag can override this..
96 cfg.tag = this.tag || (this.position == 'fixed-bottom' ? 'footer' : 'header');
99 if (this.brand !== '') {
102 href: this.brand_href ? this.brand_href : '#',
111 cfg.cls += ' main-nav';
119 getHeaderChildContainer : function()
121 if (this.el.select('.navbar-header').getCount()) {
122 return this.el.select('.navbar-header',true).first();
129 initEvents : function()
131 Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);
138 Roo.get(document).on('scroll',function(e) {
139 var ns = Roo.get(document).getScroll().top;
144 ft.removeClass('slideDown');
145 ft.addClass('slideUp');
148 ft.removeClass('slideUp');
149 ft.addClass('slideDown');