From: Edward Date: Fri, 5 Dec 2014 02:43:11 +0000 (+0800) Subject: Roo/bootstrap/menu/MenuItem.js X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=03ea1fd66371db729ec41cd4b951eed36afea9ef;p=roojs1 Roo/bootstrap/menu/MenuItem.js Roo/bootstrap/menu/MenuSeparator.js --- diff --git a/Roo/bootstrap/menu/MenuItem.js b/Roo/bootstrap/menu/MenuItem.js deleted file mode 100644 index 3b181b5433..0000000000 --- a/Roo/bootstrap/menu/MenuItem.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * - LGPL - * - * menu item - * - */ -Roo.bootstrap.menu = Roo.bootstrap.menu || {}; - -/** - * @class Roo.bootstrap.menu.MenuItem - * @extends Roo.bootstrap.Component - * Bootstrap MenuItem class - * @cfg {Boolean} submenu (true | false) default false - * @cfg {String} html text of the item - * @cfg {String} href the link - * @cfg {Boolean} preventDefault (true | false) default true - * - * - * @constructor - * Create a new MenuItem - * @param {Object} config The config object - */ - - -Roo.bootstrap.menu.MenuItem = function(config){ - Roo.bootstrap.menu.MenuItem.superclass.constructor.call(this, config); - this.addEvents({ - /** - * @event mouseover - * Fires when the mouse is hovering over this menu - * @param {Roo.bootstrap.menu.MenuItem} this - * @param {Roo.EventObject} e - */ - mouseover : true, - /** - * @event mouseout - * Fires when the mouse exits this menu - * @param {Roo.bootstrap.menu.MenuItem} this - * @param {Roo.EventObject} e - */ - mouseout : true, - // raw events - /** - * @event click - * The raw click event for the entire grid. - * @param {Roo.EventObject} e - */ - click : true - }); -}; - -Roo.extend(Roo.bootstrap.menu.MenuItem, Roo.bootstrap.Component, { - - submenu : false, - href : '', - html : '', - preventDefault: true, - - getAutoCreate : function() - { - var cfg = { - tag : 'li', - cls : (this.submenu) ? 'dropdown-submenu' : '', - cn : [ - { - tag : 'a', - href : this.href || '#', - html : this.html - } - ] - }; - - return cfg; - }, - - initEvents : function() - { - this.el.on('mouseover', this.onMouseOver, this); - this.el.on('mouseout', this.onMouseOut, this); - this.el.on('click', this.onClick, this); - - }, - - onClick : function(e) - { - this.fireEvent("click", this, e); - }, - - onMouseOver : function(e) - { - this.fireEvent("mouseover", this, e); - }, - - onMouseOut : function(e) - { - this.fireEvent("mouseout", this, e); - } -}); - - - - \ No newline at end of file diff --git a/Roo/bootstrap/menu/MenuSeparator.js b/Roo/bootstrap/menu/MenuSeparator.js deleted file mode 100644 index d531298e43..0000000000 --- a/Roo/bootstrap/menu/MenuSeparator.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - LGPL - * - * menu separator - * - */ -Roo.bootstrap.menu = Roo.bootstrap.menu || {}; - -/** - * @class Roo.bootstrap.menu.MenuSeparator - * @extends Roo.bootstrap.Component - * Bootstrap MenuSeparator class - * - * @constructor - * Create a new MenuItem - * @param {Object} config The config object - */ - - -Roo.bootstrap.menu.MenuSeparator = function(config){ - Roo.bootstrap.menu.MenuSeparator.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.bootstrap.menu.MenuSeparator, Roo.bootstrap.Component, { - - getAutoCreate : function(){ - var cfg = { - tag : 'li', - cls: 'divider' - }; - - return cfg; - } - -}); - - - - \ No newline at end of file