From be1a28d4d73c45ced6d2c82e76f0a2a71c94ac74 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 29 Nov 2018 13:16:49 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/Navbar.js --- Roo/bootstrap/Navbar.js | 1 + roojs-bootstrap-debug.js | 9 +++------ roojs-bootstrap.js | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Roo/bootstrap/Navbar.js b/Roo/bootstrap/Navbar.js index fc1fd00ed6..2a1b8bd130 100644 --- a/Roo/bootstrap/Navbar.js +++ b/Roo/bootstrap/Navbar.js @@ -57,6 +57,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { ce.removeClass('collapse'); ce.addClass('collapsing'); var h = ce.getHeight(); + Roo.log(h); ce.setHeight(0); // resize it ... ce.on('transitionend', function() { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index c2073aa434..a2415bb121 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -3868,19 +3868,16 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, { ce.removeClass('collapse'); ce.addClass('collapsing'); var h = ce.getHeight(); + Roo.log(h); ce.setHeight(0); // resize it ... + ce.on('transitionend', function() { - - - // now flag it as moving.. - - (function() { ce.removeClass('collapsing'); ce.addClass('show'); ce.removeClass('collapse'); ce.dom.style.height = ''; - }).defer(500); + }, this, { single: true} ); ce.setHeight(h); } else { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index d59e9cf237..6579e127da 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();ce.setHeight(0);(function(){ce.removeClass('collapsing');ce.addClass('show');ce.removeClass('collapse');ce.dom.style.height='';}).defer(500);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('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();}}); // 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