roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Wed, 26 Feb 2014 06:27:08 +0000 (14:27 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 26 Feb 2014 06:27:08 +0000 (14:27 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 4549f2f..934a3d9 100644 (file)
@@ -1433,6 +1433,13 @@ Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component,  {
         return cfg;
     },
     
+    initEvents :function () {
+        this.el.select('.navbar-toggle',true).on('click', function() {
+            this.el.select('.navbar-collapse',true).toggleClass('on');                                 
+        }, this);
+    },
+    
+    
     getChildContainer : function() {
         if (this.bar === true) {
             return this.el.select('.collapse',true).first();
index 89498fb..88db6e1 100644 (file)
@@ -40,7 +40,7 @@ this.el.addClass('on');this.el.removeClass('fade');this.el.setStyle('display','b
 //Roo/bootstrap/Navbar.js
 Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Navbar,Roo.bootstrap.Component,{sidebar:false,bar:false,brand:'',inverse:false,position:'',align:false,type:'nav',arrangement:'',getAutoCreate:function(){var A={cls:'navbar'};if(this.sidebar===true){A={tag:'div',cls:'sidebar-nav'};return A;}if(this.bar===true){A={tag:'nav',cls:'navbar',role:'navigation',cn:[{tag:'div',cls:'navbar-header',cn:[{tag:'button',type:'button',cls:'navbar-toggle','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]}]},{tag:'div',cls:'collapse navbar-collapse'}]};A.cls+=this.inverse?' navbar-inverse':' navbar-default';if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position;A.tag=this.position=='fixed-bottom'?'footer':'header';}if(this.brand!==''){A.cn[0].cn.push({tag:'a',href:'#',cls:'navbar-brand',cn:[this.brand]});}return A;}else if(this.bar===false){}else {Roo.log('Property \'bar\' in of Navbar must be either true or false')}
 A.cn=[{cls:'nav',tag:'ul'}];if(['tabs','pills'].indexOf(this.type)!==-1){A.cn[0].cls+=' nav-'+this.type}else {if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}
-A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!==-1){A.cn[0].cls+=' nav-'+this.arrangement;}if(this.align==='right'){A.cn[0].cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse';}return A;},getChildContainer:function(){if(this.bar===true){return this.el.select('.collapse',true).first();}
+A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!==-1){A.cn[0].cls+=' nav-'+this.arrangement;}if(this.align==='right'){A.cn[0].cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse';}return A;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',function(){this.el.select('.navbar-collapse',true).toggleClass('on');},this);},getChildContainer:function(){if(this.bar===true){return this.el.select('.collapse',true).first();}
 console.log(this);return this.el;}});
 //Roo/bootstrap/NavGroup.js
 Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav navbar-nav'};if(this.parent().sidebar===true){A={tag:'ul',cls:'dashboard-menu'};return A;}if(this.form===true){A={tag:'form',cls:'navbar-form'};if(this.align==='right'){A.cls+=' navbar-right';}else {A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse';}return A;}});