Roo/bootstrap/NavSidebarItem.js
authorAlan Knowles <alan@roojs.com>
Wed, 27 Aug 2014 09:26:32 +0000 (17:26 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 27 Aug 2014 09:26:32 +0000 (17:26 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 3091511..6d4cb52 100644 (file)
@@ -74,15 +74,15 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
         }
         // html..
         a.cn.push(span);
-        
+        // then badge..
         if (this.badge !== '') {
             a.cn.push({ tag: 'span',  cls : 'badge pull-right ' + (this.badgecls || ''), html: this.badge }); 
         }
-        
+        // fi
         if (this.menu) {
-            right = right || { tag : 'i', cls : '' };
-            a.cls += ' dropdown-toggle treeview';
-            right.cls += 'glyphicon glyphicon-chevron-down';
+            a.push({ tag : 'i', cls : 'glyphicon glyphicon-chevron-down'});
+            a.cls += 'dropdown-toggle treeview' ;
+            
         }
         
         
index 4cacb74..00dfb62 100644 (file)
@@ -3692,23 +3692,23 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
         if (this.active) {
             cfg.cls += ' active';
         }
-        var right = false;
-        // fixme - this should handle glyphicon or ico
+        
+        // left icon..
         if (this.glyphicon || this.icon) {
             var c = this.glyphicon  ? ('glyphicon glyphicon-'+this.glyphicon)  : this.icon;
-            right = { tag : 'i', cls : c };
-            a.cn.push(right) ;
+            a.cn.push({ tag : 'i', cls : c }) ;
         }
+        // html..
         a.cn.push(span);
-        
+        // then badge..
         if (this.badge !== '') {
             a.cn.push({ tag: 'span',  cls : 'badge pull-right ' + (this.badgecls || ''), html: this.badge }); 
         }
-        
+        // fi
         if (this.menu) {
-            right = right || { tag : 'i', cls : '' };
-            a.cls += ' dropdown-toggle treeview';
-            right.cls += 'glyphicon glyphicon-chevron-down';
+            a.push({ tag : 'i', cls : 'glyphicon glyphicon-chevron-down'});
+            a.cls += 'dropdown-toggle treeview' ;
+            
         }
         
         
index 5c154ff..3ad49a3 100644 (file)
@@ -87,8 +87,8 @@ A.cn[0].html=this.html||A.cn[0].html;if(this.menu){A.cn[0].tag='a';A.cn[0].href=
 //Roo/bootstrap/NavItem.js
 Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.NavItem,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,glyphicon:false,active:false,preventDefault:false,tabId:false,getAutoCreate:function(){var A={tag:'li',cls:'nav-item',cn:[{tag:'a',href:this.href||"#",html:this.html||''}]};if(this.active){A.cls=typeof(A.cls)=='undefined'?'active':A.cls+' active';}if(this.glyphicon||this.icon){if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i><span>'+A.cn[0].html+'</span>'}else {A.cn[0].html='<span class="glyphicon glyphicon-'+this.glyphicon+'"></span>'+A.cn[0].html;}}if(this.menu){A.cn[0].html+=" <span class='caret'></span>";}if(this.badge!==''){A.cn[0].html+=' <span class="badge">'+this.badge+'</span>';}return A;},initEvents:function(){this.el.select('a',true).on('click',this.onClick,this);this.parent().register(this);},onClick:function(e){if(this.preventDefault){e.preventDefault();}if(this.fireEvent('click',this,e)===false){return;};if(['tabs','pills'].indexOf(this.parent().type)!==-1){if(typeof(this.parent().setActiveItem)!=='undefined'){this.parent().setActiveItem(this);}}},isActive:function(){return this.active},setActive:function(A,B){this.active=A;if(!A){this.el.removeClass('active');}else if(!this.el.hasClass('active')){this.el.addClass('active');}if(B){this.fireEvent('changed',this,A);}}});
 //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,{getAutoCreate:function(){var a={tag:'a',href:this.href||'#',cls:'',html:'',cn:[]};var A={tag:'li',cls:'',cn:[a]};var span={tag:'span',html:this.html||''};if(this.active){A.cls+=' active';}var right=false;if(this.glyphicon||this.icon){var c=this.glyphicon?('glyphicon glyphicon-'+this.glyphicon):this.icon;right={tag:'i',cls:c};a.cn.push(right);}
-a.cn.push(span);if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right '+(this.badgecls||''),html:this.badge});}if(this.menu){right=right||{tag:'i',cls:''};a.cls+=' dropdown-toggle treeview';right.cls+='glyphicon glyphicon-chevron-down';}return A;}});
+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,{getAutoCreate:function(){var a={tag:'a',href:this.href||'#',cls:'',html:'',cn:[]};var A={tag:'li',cls:'',cn:[a]};var span={tag:'span',html:this.html||''};if(this.active){A.cls+=' active';}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(span);if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right '+(this.badgecls||''),html:this.badge});}if(this.menu){a.push({tag:'i',cls:'glyphicon glyphicon-chevron-down'});a.cls+='dropdown-toggle treeview';}return 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