roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Wed, 23 Nov 2016 09:05:24 +0000 (17:05 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 23 Nov 2016 09:05:24 +0000 (17:05 +0800)
roojs-bootstrap-debug.js

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

index 87e5a14..baac1f7 100644 (file)
@@ -3656,7 +3656,7 @@ Roo.extend(Roo.bootstrap.NavHeaderbar, Roo.bootstrap.NavSimplebar,  {
     },
     getHeaderChildContainer : function()
     {
-        if (this.el.select('.navbar-header').getCount()) {
+        if (this.srButton && this.el.select('.navbar-header').getCount()) {
             return this.el.select('.navbar-header',true).first();
         }
         
@@ -4434,6 +4434,12 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
     
     initEvents : function()
     { 
+        if (typeof (this.menu) != 'undefined') {
+            this.menu.parentType = this.xtype;
+            this.menu.triggerEl = this.el;
+            this.menu = this.addxtype(Roo.apply({}, this.menu));
+        }
+        
         this.el.on('click', this.onClick, this);
        
     
index 37642d8..409d5c8 100644 (file)
@@ -141,7 +141,7 @@ Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.con
 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,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar',role:'navigation',cn:[]}
 ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){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'}]}]});}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!==''){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;},getHeaderChildContainer:function(){if(this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();
+A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){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;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();
 }return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(e){var ns=Roo.get(document).getScroll().top;var os=A;A=ns;
 if(ns>os){ft.removeClass('slideDown');ft.addClass('slideUp');return;}ft.removeClass('slideUp');ft.addClass('slideDown');},this);}}});
 // Roo/bootstrap/NavSidebar.js
@@ -172,10 +172,11 @@ if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabl
 // Roo/bootstrap/NavSidebarItem.js
 Roo.bootstrap.NavSidebarItem=function(A){Roo.bootstrap.NavSidebarItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.NavSidebarItem,Roo.bootstrap.NavItem,{badgeWeight:'default',getAutoCreate:function(){var a={tag:'a',href:this.href||'#',cls:'',html:'',cn:[]}
 ;var A={tag:'li',cls:'',cn:[a]};var B={tag:'span',html:this.html||''};if(this.active){A.cls+=' active';}if(this.disabled){A.cls+=' disabled';}if(this.glyphicon||this.icon){var c=this.glyphicon?('glyphicon glyphicon-'+this.glyphicon):this.icon;a.cn.push({tag:'i',cls:c}
-);}a.cn.push(B);if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right badge-'+this.badgeWeight,html:this.badge});}if(this.menu){a.cn.push({tag:'i',cls:'glyphicon glyphicon-chevron-down pull-right'});a.cls+='dropdown-toggle treeview';}return A;},initEvents:function(){this.el.on('click',this.onClick,this);
-if(this.badge!==''){this.badgeEl=this.el.select('.badge',true).first().setVisibilityMode(Roo.Element.DISPLAY);}},onClick:function(e){if(this.disabled){e.preventDefault();return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this);},disable:function(){this.setDisabled(true);
-},enable:function(){this.setDisabled(false);},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;if(A){this.el.addClass('disabled');return;}this.el.removeClass('disabled');return;},setActive:function(A){if(this.active==A){return;}this.active=A;
-if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},isActive:function(){return this.active;},setBadge:function(A){if(!this.badgeEl){return;}this.badgeEl.dom.innerHTML=A;}});
+);}a.cn.push(B);if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right badge-'+this.badgeWeight,html:this.badge});}if(this.menu){a.cn.push({tag:'i',cls:'glyphicon glyphicon-chevron-down pull-right'});a.cls+='dropdown-toggle treeview';}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;
+this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClick,this);if(this.badge!==''){this.badgeEl=this.el.select('.badge',true).first().setVisibilityMode(Roo.Element.DISPLAY);}},onClick:function(e){if(this.disabled){e.preventDefault();
+return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this);},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;if(A){this.el.addClass('disabled');
+return;}this.el.removeClass('disabled');return;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},isActive:function(){return this.active;},setBadge:function(A){if(!this.badgeEl){return;
+}this.badgeEl.dom.innerHTML=A;}});
 // Roo/bootstrap/Row.js
 Roo.bootstrap.Row=function(A){Roo.bootstrap.Row.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Row,Roo.bootstrap.Component,{getAutoCreate:function(){return {cls:'row clearfix'};}});
 // Roo/bootstrap/Element.js