From: Alan Knowles Date: Tue, 4 Dec 2018 08:25:50 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=16f1887df7cc274e045baa6747c0ca6774b08ade roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/NavHeaderbar.js --- diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 8903a61546..b43e38c260 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -4188,6 +4188,12 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar, { cfg.cls += this.inverse ? ' navbar-inverse navbar-dark bg-dark' : ' navbar-default'; + if (['light','white'].indexOf(this.weight) > -1) { + cfg.cls += ['light','white'].indexOf(this.weight) > -1 ? ' navbar-light' : ' navbar-dark'; + } + cfg.cls += ' bg-' + this.weight; + + if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) { cfg.cls += ' navbar-' + this.position + ' ' + this.position ; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 8b7fe60792..75e67cd6dc 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -167,8 +167,9 @@ else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cn[0].cl Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]} ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){var B={tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar navbar-toggler-icon'} ,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:'collapse navbar-collapse',cn:[]});A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default'; -if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position;A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]} -);}if(this.main){A.cls+=' main-nav';}return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this); +if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position; +A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav'; +}return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this); if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(e){var ns=Roo.get(document).getScroll().top;var os=A;A=ns;if(ns>os){ft.removeClass('slideDown');ft.addClass('slideUp');return;}ft.removeClass('slideUp');ft.addClass('slideDown'); },this);}}}); // Roo/bootstrap/NavSidebar.js