roojs-bootstrap.js
authorEdward <edward@roojs.com>
Fri, 19 Dec 2014 03:40:17 +0000 (11:40 +0800)
committerEdward <edward@roojs.com>
Fri, 19 Dec 2014 03:40:17 +0000 (11:40 +0800)
roojs-bootstrap-debug.js

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

index 8cf3fde..1b62be9 100644 (file)
@@ -2999,6 +2999,7 @@ Roo.extend(Roo.bootstrap.NavSimplebar, Roo.bootstrap.Navbar,  {
  * @cfg {String} brand what is brand
  * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
  * @cfg {String} brand_href href of the brand
+ * @cfg {Boolean} srButton generate the sr-only button (true | false) default true
  * 
  * @constructor
  * Create a new Sidebar
@@ -3015,22 +3016,24 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar,  {
     position: '',
     brand: '',
     brand_href: false,
+    srButton : true,
     
     
     getAutoCreate : function(){
         
-        
-        
         var   cfg = {
             tag: this.nav || 'nav',
             cls: 'navbar',
             role: 'navigation',
-            cn: [
-                {
-                    tag: 'div',
-                    cls: 'navbar-header',
-                    cn: [
-                        {
+            cn: []
+        };
+        
+        if(this.srButton){
+            cfg.cn.push({
+                tag: 'div',
+                cls: 'navbar-header',
+                cn: [
+                    {
                         tag: 'button',
                         type: 'button',
                         cls: 'navbar-toggle',
@@ -3054,15 +3057,16 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar,  {
                                 cls: 'icon-bar'
                             }
                         ]
-                        }
-                    ]
-                },
-                {
-                tag: 'div',
-                cls: 'collapse navbar-collapse'
-                }
-            ]
-        };
+                    }
+                ]
+            });
+        }
+        
+        cfg.cn.push({
+            tag: 'div',
+            cls: 'collapse navbar-collapse',
+            cn : []
+        });
         
         cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
         
index f875d8f..b2749b3 100644 (file)
@@ -75,7 +75,8 @@ this.maskEl=Roo.DomHelper.append(this.el,A,true);var B=this.el.getSize();this.ma
 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,main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar'};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}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;}});
 //Roo/bootstrap/NavHeaderbar.js
-Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,getAutoCreate:function(){var A={tag:this.nav||'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.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){A.cn[0].cn.push({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav';}return A;}});
+Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar',role:'navigation',cn:[]};if(this.srButton){A.cn.push({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'}]}]});}
+A.cn.push({tag:'div',cls:'collapse navbar-collapse',cn:[]});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.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){A.cn[0].cn.push({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav';}return A;}});
 //Roo/bootstrap/NavSidebar.js
 Roo.bootstrap.NavSidebar=function(A){Roo.bootstrap.NavSidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSidebar,Roo.bootstrap.Navbar,{sidebar:true,getAutoCreate:function(){return {tag:'div',cls:'sidebar sidebar-nav'};}});
 //Roo/bootstrap/NavGroup.js