From: Alan Knowles Date: Thu, 29 Nov 2018 07:30:11 +0000 (+0800) Subject: Roo/bootstrap/Navbar.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=839e686eee3749cb694bd3e94c33f27ad4fcdc34 Roo/bootstrap/Navbar.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index a2415bb121..316ebef4a2 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -3866,9 +3866,13 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { if (ce.hasClass('collapse')) { // show it... ce.removeClass('collapse'); - ce.addClass('collapsing'); + ce.addClass('show'); var h = ce.getHeight(); Roo.log(h); + ce.removeClass('show'); + // at this point we should be able to see it.. + ce.addClass('collapsing'); + ce.setHeight(0); // resize it ... ce.on('transitionend', function() { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 6579e127da..22e88f71bb 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -152,10 +152,10 @@ Roo.MessageBox=Roo.MessageBox||Roo.bootstrap.MessageBox;Roo.Msg=Roo.Msg||Roo.Mes // Roo/bootstrap/Navbar.js 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',function(){if(this.fireEvent('beforetoggle',this)!==false){var ce=this.el.select('.navbar-collapse',true).first();ce.toggleClass('in');if(ce.hasClass('collapse')){ce.removeClass('collapse'); -ce.addClass('collapsing');var h=ce.getHeight();Roo.log(h);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);}else{ce.addClass('collapsing'); -ce.removeClass('show');(function(){ce.removeClass('collapsing');ce.addClass('collapse');}).defer(200);}}},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.select('.collapse').getCount()){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show(); -},unmask:function(){this.maskEl.hide();}}); +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);}else{ce.addClass('collapsing');ce.removeClass('show');(function(){ce.removeClass('collapsing');ce.addClass('collapse');}).defer(200);}}},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.select('.collapse').getCount()){return this.el.select('.collapse',true).first(); +}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();}}); // Roo/bootstrap/NavSimplebar.js Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSimplebar,Roo.bootstrap.Navbar,{inverse:false,type:false,arrangement:'',align:false,weight:'light',main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar navbar-expand-lg'} ;if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;A.cn=[{cls:'nav',tag:'ul'}];this.type=this.type||'nav';if(['tabs','pills'].indexOf(this.type)!==-1){A.cn[0].cls+=' nav-'+this.type}