X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2Fbootstrap%2FMenuItem.js;fp=Roo%2Fbootstrap%2FMenuItem.js;h=0000000000000000000000000000000000000000;hp=cd2035e649d36af14d65b203823fb1ea43f9b866;hb=e01802ac69da0ec0c9ccecc295beff82c1779f68;hpb=0fa7894b7489284160ff14afdca7b6911983357f diff --git a/Roo/bootstrap/MenuItem.js b/Roo/bootstrap/MenuItem.js deleted file mode 100644 index cd2035e649..0000000000 --- a/Roo/bootstrap/MenuItem.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * - LGPL - * - * menu item - * - */ - - -/** - * @class Roo.bootstrap.MenuItem - * @extends Roo.bootstrap.Component - * Bootstrap MenuItem class - * @cfg {String} html the menu label - * @cfg {String} href the link - * @cfg {Boolean} preventDefault do not trigger A href on clicks (default false). - * @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. - * @cfg {Roo.bootsrap.Menu} menu the child menu. - * - * - * @constructor - * Create a new MenuItem - * @param {Object} config The config object - */ - - -Roo.bootstrap.MenuItem = function(config){ - Roo.bootstrap.MenuItem.superclass.constructor.call(this, config); - this.addEvents({ - // raw events - /** - * @event click - * The raw click event for the entire grid. - * @param {Roo.bootstrap.MenuItem} this - * @param {Roo.EventObject} e - */ - "click" : true - }); -}; - -Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, { - - href : false, - html : false, - preventDefault: false, - isContainer : false, - active : false, - fa: false, - - getAutoCreate : function(){ - - if(this.isContainer){ - return { - tag: 'li', - cls: 'dropdown-menu-item ' - }; - } - var ctag = { - tag: 'span', - html: 'Link' - }; - - var anc = { - tag : 'a', - cls : 'dropdown-item', - 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: [ anc ] - }; - if (this.parent().type == 'treeview') { - cfg.cls = 'treeview-menu'; - } - if (this.active) { - cfg.cls += ' active'; - } - - - - anc.href = this.href || cfg.cn[0].href ; - ctag.html = this.html || cfg.cn[0].html ; - return cfg; - }, - - initEvents: function() - { - if (this.parent().type == 'treeview') { - this.el.select('a').on('click', this.onClick, this); - } - - if (this.menu) { - this.menu.parentType = this.xtype; - this.menu.triggerEl = this.el; - this.menu = this.addxtype(Roo.apply({}, this.menu)); - } - - }, - onClick : function(e) - { - Roo.log('item on click '); - - if(this.preventDefault){ - e.preventDefault(); - } - //this.parent().hideMenuItems(); - - this.fireEvent('click', this, e); - }, - getEl : function() - { - return this.el; - } -}); - - - - \ No newline at end of file