roojs-bootstrap.js
authoredward <edward@roojs.com>
Mon, 26 Feb 2018 07:27:17 +0000 (15:27 +0800)
committeredward <edward@roojs.com>
Mon, 26 Feb 2018 07:27:17 +0000 (15:27 +0800)
roojs-bootstrap-debug.js

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

index e500b89..11c007d 100644 (file)
@@ -4660,7 +4660,11 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
         
         Roo.log(this.menu);
         
-        if (typeof (this.menu) != 'undefined') {
+        if(this.menu.instanceof(Roo.bootstrap.Menu)){
+            Roo.log('test');
+        }
+        
+        if (typeof (this.menu) != 'undefined' && !this.menu.instanceof(Roo.bootstrap.Menu)) {
             this.menu.parentType = this.xtype;
             this.menu.triggerEl = this.el;
             this.menu = this.addxtype(Roo.apply({}, this.menu));
index 42299f9..a62df96 100644 (file)
@@ -182,11 +182,11 @@ if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabl
 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',open:false,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.open){A.cls+=' open x-open';}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(){Roo.log('NavSidebarItem initEvents??');Roo.log(typeof(this.menu));Roo.log(this.menu);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;
-}});
+}return A;},initEvents:function(){Roo.log('NavSidebarItem initEvents??');Roo.log(typeof(this.menu));Roo.log(this.menu);if(this.menu.instanceof(Roo.bootstrap.Menu)){Roo.log('test');}if(typeof(this.menu)!='undefined'&&!this.menu.instanceof(Roo.bootstrap.Menu)){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