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 sr-only button (true | false) default true
17 * @cfg {Boolean} autohide a top nav bar header that hides on scroll.
20 * Create a new Sidebar
21 * @param {Object} config The config object
25 Roo.bootstrap.NavHeaderbar = function(config){
26 Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this, config);
29 Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar, {
37 getAutoCreate : function(){
40 tag: this.nav || 'nav',
55 'data-toggle': 'collapse',
60 html: 'Toggle navigation'
82 cls: 'collapse navbar-collapse',
86 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
88 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
89 cfg.cls += ' navbar-' + this.position;
91 // tag can override this..
93 cfg.tag = this.tag || (this.position == 'fixed-bottom' ? 'footer' : 'header');
96 if (this.brand !== '') {
99 href: this.brand_href ? this.brand_href : '#',
108 cfg.cls += ' main-nav';
116 initEvents : function()
118 Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);
125 Roo.get(document).on('scroll',function(e) {
126 var ns = Roo.get(document).getScroll().top;
131 ft.removeClass('slideDown');
132 ft.addClass('slideUp');
135 ft.removeClass('slideUp').
136 ft.addClass('slideDown');