Roo/bootstrap/NavGroup.js
authorAlan Knowles <alan@roojs.com>
Tue, 22 Jul 2014 08:47:25 +0000 (16:47 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 22 Jul 2014 08:47:25 +0000 (16:47 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index aaf2994..2f8753d 100644 (file)
@@ -106,7 +106,7 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
         var prev = false;
         Roo.each(this.navItems, function(v){
             if (v == item) {
-                return true;
+                return ;
             }
             if (v.isActive()) {
                 v.setActive(false, true);
index 52f7cfe..7249a0f 100644 (file)
@@ -2335,6 +2335,9 @@ Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component,  {
     {
         var prev = false;
         Roo.each(this.navItems, function(v){
+            if (v == item) {
+                return ;
+            }
             if (v.isActive()) {
                 v.setActive(false, true);
                 prev = v;
index da077bd..5d34c8e 100644 (file)
@@ -58,7 +58,7 @@ A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!
 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.bar===true){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();}});
 //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.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'}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';}