From: Alan Knowles Date: Fri, 29 Jan 2021 07:32:40 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=95f762bde4c3a364d1de0511b5de9ea358ef959c roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/NavItem.js --- diff --git a/Roo/bootstrap/NavItem.js b/Roo/bootstrap/NavItem.js index e4d0262088..0a97a9146e 100644 --- a/Roo/bootstrap/NavItem.js +++ b/Roo/bootstrap/NavItem.js @@ -241,7 +241,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component, { var p = this.parent(); - if (['tabs','pills'].indexOf(p.type)!==-1) { + if (['tabs','pills'].indexOf(p.type)!==-1 && p.pilltype) { if (typeof(p.setActiveItem) !== 'undefined') { p.setActiveItem(this); } diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 33e39ee454..379212b3c3 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -6258,7 +6258,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component, { var p = this.parent(); - if (['tabs','pills'].indexOf(p.type)!==-1) { + if (['tabs','pills'].indexOf(p.type)!==-1 && p.pilltype) { if (typeof(p.setActiveItem) !== 'undefined') { p.setActiveItem(this); } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index fa93e41333..7c0c9bc894 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -258,7 +258,7 @@ if(this.href){A.href=this.href;}if(this.fa){A.html='-1){if(A.dom.href.split("#")[0]!=document.location.toString().split("#")[0]){return;}Roo.log("NavItem - prevent Default?");e.preventDefault(); -this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this);}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in'); +this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1&&p.pilltype){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this);}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in'); }},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.NavGroup.get(this.navId);if(nv){nv.clearWasActive(this);}}this.active=A;if(!A){this.el.removeClass('active');this.navLink?this.navLink.removeClass('active'):false; }else if(!this.el.hasClass('active')){this.el.addClass('active');if(Roo.bootstrap.version==4&&this.navLink){this.navLink.addClass('active');}}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId); if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.NavGroup.get(this.navId);if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabled:function(A){this.disabled=A;if(!A){this.el.removeClass('disabled');