Roo/bootstrap/Navbar.js
authorAlan Knowles <alan@roojs.com>
Tue, 15 Jan 2019 03:13:06 +0000 (11:13 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 15 Jan 2019 03:13:06 +0000 (11:13 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Navbar.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 94577ee..4869d6a 100644 (file)
@@ -113,7 +113,7 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
         if (ce.hasClass('collapsing')) {
             return;
         }
-        
+        ce.dom.style.height = '';
                // show it...
         ce.addClass('in'); // old...
         ce.removeClass('collapse');
index f35219c..427ef4e 100644 (file)
@@ -3938,7 +3938,12 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
      */
     expand : function ()
     {
+       
         var ce = this.el.select('.navbar-collapse',true).first();
+        if (ce.hasClass('collapsing')) {
+            return;
+        }
+        ce.dom.style.height = '';
                // show it...
         ce.addClass('in'); // old...
         ce.removeClass('collapse');
@@ -3965,6 +3970,10 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
      */
     collapse : function()
     {
+        
+        if (ce.hasClass('collapsing')) {
+            return;
+        }
         var ce = this.el.select('.navbar-collapse',true).first();
         ce.removeClass('in'); // old...
         ce.setHeight(ce.getHeight());
index 9b77cfc..f5d01b6 100644 (file)
@@ -156,9 +156,9 @@ Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.cal
 ;},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();
-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);},collapse:function(){var ce=this.el.select('.navbar-collapse',true).first();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);}});
+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);},collapse:function(){if(ce.hasClass('collapsing')){return;}var ce=this.el.select('.navbar-collapse',true).first();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);}});
 // 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 roo-navbar-simple'}
 ;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(this.inverse){A.cls+=' navbar-inverse';}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}