roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Fri, 29 Jan 2021 07:39:02 +0000 (15:39 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 29 Jan 2021 07:39:02 +0000 (15:39 +0800)
roojs-bootstrap-debug.js
Roo/bootstrap/NavItem.js

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

index e621d50..1769bfc 100644 (file)
@@ -128,7 +128,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
                 }
             ];
             if (this.tagtype == 'a') {
-               cfg.cn[0].cls = 'nav-link' +  (this.active ?  ' active'  : '');
+               cfg.cn[0].cls = 'nav-link' +  (this.active ?  ' active'  : '') + ' ' + this.linkcls;
         
            }
             if (this.icon) {
index 379212b..974748e 100644 (file)
@@ -6037,7 +6037,7 @@ Roo.apply(Roo.bootstrap.NavGroup, {
  * @cfg {String} fa - Fontawsome icon name (can add stuff to it like fa-2x)
  * @cfg {Boolean} active Is item active
  * @cfg {Boolean} disabled Is item disabled
+ * @cfg {String} linkcls  Link Class
  * @cfg {Boolean} preventDefault (true | false) default false
  * @cfg {String} tabId the tab that this item activates.
  * @cfg {String} tagtype (a|span) render as a href or span?
@@ -6096,7 +6096,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
     was_active : false,
     button_weight : '',
     button_outline : false,
-    
+    linkcls : '',
     navLink: false,
     
     getAutoCreate : function(){
@@ -6145,7 +6145,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
                 }
             ];
             if (this.tagtype == 'a') {
-               cfg.cn[0].cls = 'nav-link' +  (this.active ?  ' active'  : '');
+               cfg.cn[0].cls = 'nav-link' +  (this.active ?  ' active'  : '') + ' ' + this.linkcls;
         
            }
             if (this.icon) {
index 7c0c9bc..78eb4c9 100644 (file)
@@ -249,10 +249,10 @@ return false;}return true;});return B;},setActiveNext:function(){var i=this.inde
 }this.setActiveItem(this.navItems[i-1]);},clearWasActive:function(A){Roo.each(this.navItems,function(e){if(e.tabId!=A.tabId&&e.was_active){e.was_active=false;return false;}return true;});},getWasActive:function(){var r=false;Roo.each(this.navItems,function(e){if(e.was_active){r=e;
 return false;}return true;});return r;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}});
 // Roo/bootstrap/NavItem.js
-Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.NavItem,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',tag:'li',disabled:false,animateRef:false,was_active:false,button_weight:'',button_outline:false,navLink:false,getAutoCreate:function(){var A={tag:this.tag,cls:'nav-item'}
+Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.NavItem,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',tag:'li',disabled:false,animateRef:false,was_active:false,button_weight:'',button_outline:false,linkcls:'',navLink:false,getAutoCreate:function(){var A={tag:this.tag,cls:'nav-item'}
 ;A.cls=typeof(A.cls)=='undefined'?'':A.cls;if(this.active){A.cls+=' active';}if(this.disabled){A.cls+=' disabled';}if(this.button_weight.length){A.tag=this.href?'a':'button';A.html=this.html||'';A.cls+=' btn btn'+(this.button_outline?'-outline':'')+'-'+this.button_weight;
 if(this.href){A.href=this.href;}if(this.fa){A.html='<i class="fa fas fa-'+this.fa+'"></i> <span>'+this.html+'</span>';}if(this.badge!==''){A.html+=' <span class="badge badge-secondary">'+this.badge+'</span>';}return A;}if(this.href||this.html||this.glyphicon||this.icon||this.fa){A.cn=[{tag:this.tagtype,href:this.href||"#",html:this.html||''}
-];if(this.tagtype=='a'){A.cn[0].cls='nav-link'+(this.active?' active':'');}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i> <span>'+A.cn[0].html+'</span>';}if(this.fa){A.cn[0].html='<i class="fa fas fa-'+this.fa+'"></i> <span>'+A.cn[0].html+'</span>';
+];if(this.tagtype=='a'){A.cn[0].cls='nav-link'+(this.active?' active':'')+' '+this.linkcls;}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i> <span>'+A.cn[0].html+'</span>';}if(this.fa){A.cn[0].html='<i class="fa fas fa-'+this.fa+'"></i> <span>'+A.cn[0].html+'</span>';
 }if(this.glyphicon){A.cn[0].html='<span class="glyphicon glyphicon-'+this.glyphicon+'"></span> '+A.cn[0].html;}if(this.menu){A.cn[0].html+=" <span class='caret'></span>";}if(this.badge!==''){A.cn[0].html+=' <span class="badge badge-secondary">'+this.badge+'</span>';
 }}return A;},onRender:function(ct,A){if(Roo.bootstrap.version==4&&ct.dom.type!='ul'){this.tag='div';}var B=Roo.bootstrap.NavItem.superclass.onRender.call(this,ct,A);this.navLink=this.el.select('.nav-link',true).first();return B;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;
 this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.select('a',true).on('click',this.onClick,this);if(this.tagtype=='span'){this.el.select('span',true).on('click',this.onClick,this);}this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return;