Roo/bootstrap/NavSimplebar.js
[roojs1] / Roo / bootstrap / NavSimplebar.js
index 5182560..844ab8f 100644 (file)
@@ -9,6 +9,20 @@
  * @class Roo.bootstrap.NavSimplebar
  * @extends Roo.bootstrap.Navbar
  * Bootstrap Sidebar class
+ *
+ * @cfg {Boolean} inverse is inverted color
+ * 
+ * @cfg {String} type (nav | pills | tabs)
+ * @cfg {Boolean} arrangement stacked | justified
+ * @cfg {String} align (left | right) alignment
+ * 
+ * @cfg {Boolean} main (true|false) main nav bar? default false
+ * @cfg {Boolean} loadMask (true|false) loadMask on the bar
+ * 
+ * @cfg {String} tag (header|footer|nav|div) default is nav 
+
+ * @cfg {String} weight (light|primary|secondary|success|danger|warning|info|dark|white) default is light.
+ * 
  * 
  * @constructor
  * Create a new Sidebar
@@ -22,16 +36,17 @@ Roo.bootstrap.NavSimplebar = function(config){
 
 Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar,  {
     
-    
-    brand: '',
     inverse: false,
-    position: '',
-    align : false,
+    
     type: false,
     arrangement: '',
-    brand_href: false,
+    align : false,
+    
+    weight : 'light',
+    
     main : false,
-    loadMask : false,
+    
+    
     tag : false,
     
     
@@ -39,9 +54,27 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar,  {
         
         
         var cfg = {
-            cls : 'navbar'
+            tag : this.tag || 'div',
+            cls : 'navbar navbar-expand-lg roo-navbar-simple'
         };
-         
+       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 (this.inverse) {
+            cfg.cls += ' navbar-inverse';
+            
+        }
+       
+       // i'm not actually sure these are really used - normally we add a navGroup to a navbar
+       
+       if (Roo.bootstrap.version == 4) {
+            return cfg;
+       }
+       
+       
+    
        
         cfg.cn = [
             {
@@ -52,8 +85,10 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar,  {
         
          
         this.type = this.type || 'nav';
-        if (['tabs','pills'].indexOf(this.type)!==-1) {
+        if (['tabs','pills'].indexOf(this.type) != -1) {
             cfg.cn[0].cls += ' nav-' + this.type
+        
+        
         } else {
             if (this.type!=='nav') {
                 Roo.log('nav type must be nav/tabs/pills')
@@ -64,7 +99,7 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar,  {
         
         
         
-        if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
+        if (['stacked','justified'].indexOf(this.arrangement) != -1) {
             cfg.cn[0].cls += ' nav-' + this.arrangement;
         }
         
@@ -73,10 +108,7 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar,  {
             cfg.cn[0].cls += ' navbar-right';
         }
         
-        if (this.inverse) {
-            cfg.cls += ' navbar-inverse';
-            
-        }
+        
         
         
         return cfg;