From b804efa73c2b72641f2e34fa4cf7273f8dec227c Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 29 Jan 2021 15:39:02 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/NavItem.js --- Roo/bootstrap/NavItem.js | 2 +- roojs-bootstrap-debug.js | 6 +++--- roojs-bootstrap.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Roo/bootstrap/NavItem.js b/Roo/bootstrap/NavItem.js index e621d50287..1769bfc595 100644 --- a/Roo/bootstrap/NavItem.js +++ b/Roo/bootstrap/NavItem.js @@ -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) { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 379212b3c3..974748e0f5 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -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) { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 7c0c9bc894..78eb4c901d 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -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=' '+this.html+'';}if(this.badge!==''){A.html+=' '+this.badge+'';}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=' '+A.cn[0].html+'';}if(this.fa){A.cn[0].html=' '+A.cn[0].html+''; +];if(this.tagtype=='a'){A.cn[0].cls='nav-link'+(this.active?' active':'')+' '+this.linkcls;}if(this.icon){A.cn[0].html=' '+A.cn[0].html+'';}if(this.fa){A.cn[0].html=' '+A.cn[0].html+''; }if(this.glyphicon){A.cn[0].html=' '+A.cn[0].html;}if(this.menu){A.cn[0].html+=" ";}if(this.badge!==''){A.cn[0].html+=' '+this.badge+''; }}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; -- 2.39.2