From dae0d530896eb038c43e53ce53cca5636eac68f2 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 29 Nov 2018 13:04:22 +0800 Subject: [PATCH] Roo/bootstrap/Navbar.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/Navbar.js | 3 ++- roojs-bootstrap-debug.js | 9 +++++++-- roojs-bootstrap.js | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Roo/bootstrap/Navbar.js b/Roo/bootstrap/Navbar.js index d02d393190..b6e062081a 100644 --- a/Roo/bootstrap/Navbar.js +++ b/Roo/bootstrap/Navbar.js @@ -58,10 +58,11 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { (function() { ce.setHeight(ce.getHeight()); // resize it ... ce.removeClass('collapsing'); + ce.addClass('collapsing'); }).defer(50); // now flag it as moving.. - ce.addClass('collapsing'); + (function() { ce.removeClass('collapsing'); }).defer(100); } else { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 54c7dd8aa3..5b2c6752d7 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -3866,9 +3866,14 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { if (ce.hasClass('collapse')) { // show it... ce.removeClass('collapse show'); - ce.setHeight(ce.getHeight()); // resize it ... + (function() { + ce.setHeight(ce.getHeight()); // resize it ... + ce.removeClass('collapsing'); + ce.addClass('collapsing'); + }).defer(50); + // now flag it as moving.. - ce.addClass('collapsing'); + (function() { ce.removeClass('collapsing'); }).defer(100); } else { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 33c888fed1..7ae463f546 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -152,9 +152,9 @@ 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 show'); -ce.setHeight(ce.getHeight());ce.addClass('collapsing');(function(){ce.removeClass('collapsing');}).defer(100);}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();}}); +(function(){ce.setHeight(ce.getHeight());ce.removeClass('collapsing');ce.addClass('collapsing');}).defer(50);(function(){ce.removeClass('collapsing');}).defer(100);}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} -- 2.39.2