From: Alan Knowles Date: Tue, 4 Dec 2018 09:34:29 +0000 (+0800) Subject: Roo/bootstrap/NavItem.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=d6f557c797ec633c87c6f7fd862098c6c5d871a8 Roo/bootstrap/NavItem.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/Roo/bootstrap/NavItem.js b/Roo/bootstrap/NavItem.js index 469731dfc3..32654fba59 100644 --- a/Roo/bootstrap/NavItem.js +++ b/Roo/bootstrap/NavItem.js @@ -138,7 +138,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component, { } var ret = Roo.bootstrap.NavItem.superclass.onRender.call(this, ct, position); - this.navLink = this.el.select('nav-link').first(); + this.navLink = this.el.select('.nav-link',true).first(); return ret; }, diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index cc9f546736..5f023177fa 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -4743,7 +4743,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component, { } var ret = Roo.bootstrap.NavItem.superclass.onRender.call(this, ct, position); - this.navLink = this.el.select('nav-link').first(); + this.navLink = this.el.select('.nav-link',true).first(); return ret; }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 87f7cdbc51..d937a240c0 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -190,7 +190,7 @@ Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.c ;if(this.active){A.cls=typeof(A.cls)=='undefined'?'active':A.cls+' active';}if(this.disabled){A.cls+=' disabled';}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'; }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').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({} +}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;}if(this.preventDefault||this.href=='#'){Roo.log("NavItem - prevent Default?"); e.preventDefault();}if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return;};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first(); if(A&&this.animateRef&&this.href.indexOf('#')>-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);