* @cfg {Boolean} preventDefault do not trigger A href on clicks.
* @cfg {Boolean} isContainer is it a container - just returns a drop down item..
* @cfg {Boolean} active used on sidebars to highlight active itesm
+ * @cfg {String} fa favicon to show on left of menu item.
*
*
* @constructor
html : false,
preventDefault: true,
isContainer : false,
+ active : false,
+ fa: false,
getAutoCreate : function(){
cls: 'dropdown-menu-item'
};
}
+ var ctag = {
+ tag: 'span',
+ html: 'Link'
+ };
+
+ var anc = {
+ tag : 'a',
+ href : '#',
+ cn : [ ]
+ };
+
+ if (this.fa !== false) {
+ anc.cn.push({
+ tag : 'i',
+ cls : 'fa fa-' + this.fa
+ });
+ }
+
+ anc.cn.push(ctag);
+
var cfg= {
tag: 'li',
cls: 'dropdown-menu-item',
- cn: [
- {
- tag : 'a',
- href : '#',
- html : 'Link'
- }
- ]
+ cn: [ anc ]
};
if (this.parent().type == 'treeview') {
cfg.cls = 'treeview-menu';
- cfg.cn[0].href = this.href || cfg.cn[0].href ;
- cfg.cn[0].html = this.html || cfg.cn[0].html ;
+ anc.href = this.href || cfg.cn[0].href ;
+ ctag.html = this.html || cfg.cn[0].html ;
return cfg;
},
}if(this.isVisible()){Roo.log('hide');this.hide();}else{Roo.log('show');this.show(this.triggerEl,false,false);}e.stopEvent();},hideMenuItems:function(){Roo.log("hide Menu Items");if(!this.el){return;}this.el.select('.open',true).each(function(aa){aa.removeClass('open');
});},addxtypeChild:function(A,B){var C=Roo.bootstrap.Menu.superclass.addxtypeChild.call(this,A,B);this.menuitems.add(C);return C;},getEl:function(){Roo.log(this.el);return this.el;}});
// Roo/bootstrap/MenuItem.js
-Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:true,isContainer:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item'}
-;}var A={tag:'li',cls:'dropdown-menu-item',cn:[{tag:'a',href:'#',html:'Link'}]};if(this.parent().type=='treeview'){A.cls='treeview-menu';}if(this.active){A.cls+=' active';}A.cn[0].href=this.href||A.cn[0].href;A.cn[0].html=this.html||A.cn[0].html;return A;
-},initEvents:function(){if(this.parent().type=='treeview'){this.el.select('a').on('click',this.onClick,this);}},onClick:function(e){Roo.log('item on click ');this.fireEvent('click',this,e);},getEl:function(){return this.el;}});
+Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:true,isContainer:false,active:false,fa:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item'}
+;}var A={tag:'span',html:'Link'};var B={tag:'a',href:'#',cn:[]};if(this.fa!==false){B.cn.push({tag:'i',cls:'fa fa-'+this.fa});}B.cn.push(A);var C={tag:'li',cls:'dropdown-menu-item',cn:[B]};if(this.parent().type=='treeview'){C.cls='treeview-menu';}if(this.active){C.cls+=' active';
+}B.href=this.href||C.cn[0].href;A.html=this.html||C.cn[0].html;return C;},initEvents:function(){if(this.parent().type=='treeview'){this.el.select('a').on('click',this.onClick,this);}},onClick:function(e){Roo.log('item on click ');this.fireEvent('click',this,e);
+},getEl:function(){return this.el;}});
// Roo/bootstrap/MenuSeparator.js
Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuSeparator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={cls:'divider',tag:'li'};return A;}});
// Roo/bootstrap/Modal.js