Roo/bootstrap/NavItem.js
authorAlan Knowles <alan@roojs.com>
Thu, 28 Jan 2021 08:53:33 +0000 (16:53 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 28 Jan 2021 08:53:33 +0000 (16:53 +0800)
Roo/bootstrap/NavItem.js

index 9491b33..5e0757b 100644 (file)
@@ -89,8 +89,10 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
             cls: 'nav-item'
         };
         
+       cfg.cls =  typeof(cfg.cls) == 'undefined'  ? '' : cfg.cls;
+       
         if (this.active) {
-            cfg.cls = typeof(cfg.cls) == 'undefined' ? 'active' : cfg.cls + ' active';
+            cfg.cls +=  ' active' ;
         }
         if (this.disabled) {
             cfg.cls += ' disabled';
@@ -126,7 +128,8 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
                 }
             ];
             if (this.tagtype == 'a') {
-               cfg.cn[0].cls = 'nav-link';
+               cfg.cn[0].cls = 'nav-link' +  (this.active ?  ' active'  : '');
+        
            }
             if (this.icon) {
                 cfg.cn[0].html = '<i class="'+this.icon+'"></i> <span>' + cfg.cn[0].html + '</span>';