Roo/bootstrap/NavSidebarItem.js
authorAlan Knowles <alan@roojs.com>
Mon, 21 Mar 2016 07:32:40 +0000 (15:32 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 21 Mar 2016 07:32:40 +0000 (15:32 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 6ac4c6a..0d789e5 100644 (file)
@@ -102,7 +102,8 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
     initEvents : function()
     { 
         this.el.on('click', this.onClick, this);
-        
+        Roo.log("set badgeEl? ", this.badge);
+    
         if(this.badge !== ''){
             Roo.log("set badgeEl");
             this.badgeEl = this.el.select('.badge', true).first().setVisibilityMode(Roo.Element.DISPLAY);
index 9d1eaba..5259e53 100644 (file)
@@ -4398,7 +4398,8 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
     initEvents : function()
     { 
         this.el.on('click', this.onClick, this);
-        
+        Roo.log("set badgeEl? ", this.badge);
+    
         if(this.badge !== ''){
             Roo.log("set badgeEl");
             this.badgeEl = this.el.select('.badge', true).first().setVisibilityMode(Roo.Element.DISPLAY);
index 4261474..aaffc2f 100644 (file)
@@ -174,7 +174,7 @@ this.fireEvent('scrollto',this,B,e);Roo.get(c).scrollTo('top',B.value,true);retu
 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 span={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(span);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!==''){Roo.log("set badgeEl");this.badgeEl=this.el.select('.badge',true).first().setVisibilityMode(Roo.Element.DISPLAY);}},onClick:function(e){if(this.disabled){e.preventDefault();
+},initEvents:function(){this.el.on('click',this.onClick,this);Roo.log("set badgeEl? ",this.badge);if(this.badge!==''){Roo.log("set badgeEl");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;}});