From 6b29d5e57e611c3ac3c989e1dbc8676824d676ff Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 24 Jan 2019 17:19:19 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/NavItem.js Roo/bootstrap/Navbar.js Roo/bootstrap/NavHeaderbar.js --- Roo/bootstrap/NavHeaderbar.js | 2 +- Roo/bootstrap/NavItem.js | 2 +- Roo/bootstrap/Navbar.js | 6 +++--- roojs-bootstrap-debug.js | 8 ++++---- roojs-bootstrap.js | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Roo/bootstrap/NavHeaderbar.js b/Roo/bootstrap/NavHeaderbar.js index d64fc7b2a6..2237599fbf 100644 --- a/Roo/bootstrap/NavHeaderbar.js +++ b/Roo/bootstrap/NavHeaderbar.js @@ -93,7 +93,7 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar, { cn.push({ tag: 'div', - cls: Roo.bootstrap.version == 4 ? 'nav flex-row roo-navbar-collapse' : 'collapse navbar-collapse', + cls: Roo.bootstrap.version == 4 ? 'nav flex-row roo-navbar-collapse' : 'collapse navbar-collapse roo-navbar-collapse', cn : [] }); diff --git a/Roo/bootstrap/NavItem.js b/Roo/bootstrap/NavItem.js index 94ba75afd0..9491b332e7 100644 --- a/Roo/bootstrap/NavItem.js +++ b/Roo/bootstrap/NavItem.js @@ -247,7 +247,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component, { // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu. if (p.parentType == 'NavHeaderbar' && !this.menu) { // remove the collapsed menu expand... - p.parent().el.select('.navbar-collapse',true).removeClass('in'); + p.parent().el.select('.roo-navbar-collapse',true).removeClass('in'); } }, diff --git a/Roo/bootstrap/Navbar.js b/Roo/bootstrap/Navbar.js index daab8fe1a0..37bfcb26b4 100644 --- a/Roo/bootstrap/Navbar.js +++ b/Roo/bootstrap/Navbar.js @@ -92,7 +92,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { if(this.fireEvent('beforetoggle', this) === false){ return; } - var ce = this.el.select('.navbar-collapse',true).first(); + var ce = this.el.select('.roo-navbar-collapse',true).first(); if (!ce.hasClass('show')) { this.expand(); @@ -109,7 +109,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { expand : function () { - var ce = this.el.select('.navbar-collapse',true).first(); + var ce = this.el.select('.roo-navbar-collapse',true).first(); if (ce.hasClass('collapsing')) { return; } @@ -141,7 +141,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { */ collapse : function() { - var ce = this.el.select('.navbar-collapse',true).first(); + var ce = this.el.select('.roo-navbar-collapse',true).first(); if (ce.hasClass('collapsing') || ce.hasClass('collapse') ) { // it's collapsed or collapsing.. diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 365d947702..af3cee2d80 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -3924,7 +3924,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { if(this.fireEvent('beforetoggle', this) === false){ return; } - var ce = this.el.select('.navbar-collapse',true).first(); + var ce = this.el.select('.roo-navbar-collapse',true).first(); if (!ce.hasClass('show')) { this.expand(); @@ -3941,7 +3941,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { expand : function () { - var ce = this.el.select('.navbar-collapse',true).first(); + var ce = this.el.select('.roo-navbar-collapse',true).first(); if (ce.hasClass('collapsing')) { return; } @@ -4222,7 +4222,7 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar, { cn.push({ tag: 'div', - cls: Roo.bootstrap.version == 4 ? 'nav flex-row' : 'collapse navbar-collapse', + cls: Roo.bootstrap.version == 4 ? 'nav flex-row roo-navbar-collapse' : 'collapse navbar-collapse', cn : [] }); @@ -4892,7 +4892,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component, { // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu. if (p.parentType == 'NavHeaderbar' && !this.menu) { // remove the collapsed menu expand... - p.parent().el.select('.navbar-collapse',true).removeClass('in'); + p.parent().el.select('.roo-navbar-collapse',true).removeClass('in'); } }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 13f4389bcf..13c3860c5b 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -155,7 +155,7 @@ Roo.Msg=Roo.Msg||Roo.MessageBox; Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.call(this,A);this.addEvents({"beforetoggle":true});};Roo.extend(Roo.bootstrap.Navbar,Roo.bootstrap.Component,{navItems:false,loadMask:false,getAutoCreate:function(){throw {message:"nav bar is now a abstract base class - use NavSimplebar / NavHeaderbar / NavSidebar etc..."} ;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',this.onToggle,this);var A={tag:"div",cls:"x-dlg-mask"};this.maskEl=Roo.DomHelper.append(this.el,A,true);var B=this.el.getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block"); this.maskEl.hide();if(this.loadMask){this.maskEl.show();}},getChildContainer:function(){if(this.el&&this.el.select('.collapse').getCount()){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide(); -},onToggle:function(){if(this.fireEvent('beforetoggle',this)===false){return;}var ce=this.el.select('.navbar-collapse',true).first();if(!ce.hasClass('show')){this.expand();}else{this.collapse();}},expand:function(){var ce=this.el.select('.navbar-collapse',true).first(); +},onToggle:function(){if(this.fireEvent('beforetoggle',this)===false){return;}var ce=this.el.select('.roo-navbar-collapse',true).first();if(!ce.hasClass('show')){this.expand();}else{this.collapse();}},expand:function(){var ce=this.el.select('.roo-navbar-collapse',true).first(); if(ce.hasClass('collapsing')){return;}ce.dom.style.height='';ce.addClass('in');ce.removeClass('collapse');ce.addClass('show');var h=ce.getHeight();Roo.log(h);ce.removeClass('show');ce.addClass('collapsing');ce.setHeight(0);ce.on('transitionend',function(){ce.removeClass('collapsing'); ce.addClass('show');ce.removeClass('collapse');ce.dom.style.height='';},this,{single:true});ce.setHeight(h);ce.dom.scrollTop=0;},collapse:function(){var ce=this.el.select('.navbar-collapse',true).first();if(ce.hasClass('collapsing')||ce.hasClass('collapse')){return; }ce.removeClass('in');ce.setHeight(ce.getHeight());ce.removeClass('show');ce.addClass('collapsing');ce.on('transitionend',function(){ce.dom.style.height='';ce.removeClass('collapsing');ce.addClass('collapse');},this,{single:true});ce.setHeight(0);}}); @@ -167,7 +167,7 @@ Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.con // Roo/bootstrap/NavHeaderbar.js Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]} ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){var B={tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar navbar-toggler-icon'} -,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row':'collapse navbar-collapse',cn:[]});A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default'; +,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row roo-navbar-collapse':'collapse navbar-collapse',cn:[]});A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default'; if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position; A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav'; }return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this); @@ -196,7 +196,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('.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(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');}else if(!this.el.hasClass('disabled')){this.el.addClass('disabled');}},tooltipEl:function(){return this.el.select(''+this.tagtype+'',true).first(); -- 2.39.2