Roo/bootstrap/NavGroup.js
authorAlan Knowles <alan@roojs.com>
Tue, 4 Dec 2018 08:45:53 +0000 (16:45 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 4 Dec 2018 08:45:53 +0000 (16:45 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/NavGroup.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 37f16dc..5fd5f03 100644 (file)
@@ -58,8 +58,10 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
             cls: 'nav' 
         };
         if (Roo.bootstrap.version == 4) {
-           if (['nav','pills'].indexOf(this.type) != -1) {
-               cfg.cls = ' navbar-' + this.type; 
+           if (['tabs','pills'].indexOf(this.type) != -1) {
+               cfg.cls = ' nav-' + this.type; 
+           } else {
+               cfg.cls += ' navbar-nav';
            }
        } else {
            if (['tabs','pills'].indexOf(this.type) != -1) {
index b43e38c..9132b8b 100644 (file)
@@ -4371,8 +4371,10 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
             cls: 'nav' 
         };
         if (Roo.bootstrap.version == 4) {
-           if (['nav','pills'].indexOf(this.type) != -1) {
-               cfg.cls = ' navbar-' + this.type; 
+           if (['tabs','pills'].indexOf(this.type) != -1) {
+               cfg.cls = ' nav-' + this.type; 
+           } else {
+               cfg.cls += ' navbar-nav';
            }
        } else {
            if (['tabs','pills'].indexOf(this.type) != -1) {
index 75e67cd..afca1a5 100644 (file)
@@ -176,7 +176,7 @@ if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(
 Roo.bootstrap.NavSidebar=function(A){Roo.bootstrap.NavSidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSidebar,Roo.bootstrap.Navbar,{sidebar:true,getAutoCreate:function(){return {tag:'div',cls:'sidebar sidebar-nav'};}});
 // Roo/bootstrap/NavGroup.js
 Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.NavGroup.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',navItems:false,getAutoCreate:function(){var A=Roo.apply({}
-,Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(Roo.bootstrap.version==4){if(['nav','pills'].indexOf(this.type)!=-1){A.cls=' navbar-'+this.type;}}else{if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type}
+,Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(Roo.bootstrap.version==4){if(['tabs','pills'].indexOf(this.type)!=-1){A.cls=' nav-'+this.type;}else{A.cls+=' navbar-nav';}}else{if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type}
 else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cls+=' navbar-nav'}}if(this.parent()&&this.parent().sidebar){A={tag:'ul',cls:'dashboard-menu sidebar-menu'};return A;}if(this.form===true){A={tag:'form',cls:'navbar-form form-inline'}
 ;if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' mr-auto';}if(this.inverse){A.cls+=' navbar-inverse';}return A;},setActiveItem:function(A){var B=false;
 Roo.each(this.navItems,function(v){if(v==A){return;}if(v.isActive()){v.setActive(false,true);B=v;}});A.setActive(true,true);this.fireEvent('changed',this,A,B);},getActive:function(){var A=false;Roo.each(this.navItems,function(v){if(v.isActive()){A=v;}});return A;