Roo/bootstrap/NavGroup.js
authorEdward <edward@roojs.com>
Fri, 22 Aug 2014 05:09:36 +0000 (13:09 +0800)
committerEdward <edward@roojs.com>
Fri, 22 Aug 2014 05:09:36 +0000 (13:09 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 2f8753d..11307c6 100644 (file)
@@ -65,7 +65,9 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
             }
             cfg.cls += ' navbar-nav'
         }
+        Roo.log('parent');
         
+        Roo.log(this.parent());
         if (this.parent().sidebar === true) {
             cfg = {
                 tag: 'ul',
index d644e84..a4aaf78 100644 (file)
@@ -3154,7 +3154,9 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
             }
             cfg.cls += ' navbar-nav'
         }
+        Roo.log('parent');
         
+        Roo.log(this.parent());
         if (this.parent().sidebar === true) {
             cfg = {
                 tag: 'ul',
index 0b8cbf6..f681341 100644 (file)
@@ -77,7 +77,8 @@ Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.con
 Roo.bootstrap.NavSidebar=function(A){Roo.bootstrap.NavSidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSidebar,Roo.bootstrap.Navbar,{getAutoCreate:function(){return {tag:'div',cls:'sidebar-nav'};}});
 //Roo/bootstrap/NavGroup.js
 Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.NavGroup.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',navItems:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(['tabs','pills'].indexOf(this.type)!==-1){A.cls+=' nav-'+this.type}else {if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}
-A.cls+=' 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;},setActiveItem:function(A){var B=false;Roo.each(this.navItems,function(v){if(v==A){return;}if(v.isActive()){v.setActive(false,true);B=v;}});A.setActive(true,true);this.fireEvent('changed',this,A,B);},register:function(A){this.navItems.push(A);A.navId=this.navId;},getNavItem:function(A){var B=false;Roo.each(this.navItems,function(e){if(e.tabId==A){B=e;return false;}return true;});return B;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){return this.groups[A];}});
+A.cls+=' navbar-nav'}
+Roo.log('parent');Roo.log(this.parent());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;},setActiveItem:function(A){var B=false;Roo.each(this.navItems,function(v){if(v==A){return;}if(v.isActive()){v.setActive(false,true);B=v;}});A.setActive(true,true);this.fireEvent('changed',this,A,B);},register:function(A){this.navItems.push(A);A.navId=this.navId;},getNavItem:function(A){var B=false;Roo.each(this.navItems,function(e){if(e.tabId==A){B=e;return false;}return true;});return B;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){return this.groups[A];}});
 //Roo/bootstrap/Navbar/Item.js
 Roo.bootstrap.Navbar.Item=function(A){Roo.bootstrap.Navbar.Item.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.Navbar.Item,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,glyphicon:false,active:false,preventDefault:false,tabId:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));if(this.parent().parent().sidebar===true){A={tag:'li',cls:'',cn:[{tag:'p',cls:''}]};if(this.html){A.cn[0].html=this.html;}if(this.active){this.cls+=' active';}if(this.menu){A.cn[0].cls+=' dropdown-toggle';A.cn[0].html=(A.cn[0].html||this.html)+'<span class="glyphicon glyphicon-chevron-down"></span>';}if(this.href){A.cn[0].tag='a',A.cn[0].href=this.href;}if(this.glyphicon){A.cn[0].html='<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i><span>'+A.cn[0].html||this.html+'</span>'}return A;}
 A={tag:'li',cls:'nav-item'};if(this.active){A.cls=typeof(A.cls)=='undefined'?'active':A.cls+' active';}