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, {
38 user_container : true,
41 getAutoCreate : function(){
44 tag: this.nav || 'nav',
59 'data-toggle': 'collapse',
64 html: 'Toggle navigation'
86 cls: 'collapse navbar-collapse',
90 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
92 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
93 cfg.cls += ' navbar-' + this.position;
95 // tag can override this..
97 cfg.tag = this.tag || (this.position == 'fixed-bottom' ? 'footer' : 'header');
100 if (this.brand !== '') {
103 href: this.brand_href ? this.brand_href : '#',
112 cfg.cls += ' main-nav';
120 getHeaderChildContainer : function()
122 if (this.el.select('.navbar-header').getCount()) {
123 return this.el.select('.navbar-header',true).first();
126 return this.getChildContainer();
130 initEvents : function()
132 Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);
139 Roo.get(document).on('scroll',function(e) {
140 var ns = Roo.get(document).getScroll().top;
145 ft.removeClass('slideDown');
146 ft.addClass('slideUp');
149 ft.removeClass('slideUp');
150 ft.addClass('slideDown');