X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsrc%2FRoo_bootstrap_menu_Item.js.html;h=dc7588d70e6c98020792cc724f43c0c73f9ccf0a;hb=23a0c8c1c7942f78ddb512df49e0ff19f12b06fa;hp=d0f1d110fb1cfe208283cbe17109525341adf2f3;hpb=7811bdad238a16fa881fa617d9c4e53da624968e;p=roojs1 diff --git a/docs/src/Roo_bootstrap_menu_Item.js.html b/docs/src/Roo_bootstrap_menu_Item.js.html index d0f1d110fb..dc7588d70e 100644 --- a/docs/src/Roo_bootstrap_menu_Item.js.html +++ b/docs/src/Roo_bootstrap_menu_Item.js.html @@ -1,20 +1,21 @@ -Roo/bootstrap/menu/Item.js /** +Roo/bootstrap/menu/Item.js/** * @class Roo.bootstrap.menu.Item * @extends Roo.bootstrap.Component + * @children Roo.bootstrap.Button Roo.bootstrap.ButtonUploader Roo.bootstrap.Row Roo.bootstrap.Column Roo.bootstrap.Container * @licence LGPL * Bootstrap MenuItem class - * @cfg {Boolean} submenu default false - - * @cfg {String} html text of the item + * + * @cfg {String} html the menu label * @cfg {String} href the link - * @cfg {Boolean} disabled is the item disabled - default false - * @cfg {Boolean} preventDefault stop trigger click event to parent elements - default true - * @cfg {String} fa Font awesome icon - * @cfg {String} pos (left|right) Submenu align to default right + * @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 Menu Item + * Create a new MenuItem * @param {Object} config The config object */ @@ -22,45 +23,27 @@ Roo.bootstrap.menu.Item = function(config){ Roo.bootstrap.menu.Item.superclass.constructor.call(this, config); this.addEvents({ - /** - * @event mouseover - * Fires when the mouse is hovering over this menu - * @param {Roo.bootstrap.menu.Item} this - * @param {Roo.EventObject} e - */ - mouseover : true, - /** - * @event mouseout - * Fires when the mouse exits this menu - * @param {Roo.bootstrap.menu.Item} this - * @param {Roo.EventObject} e - */ - mouseout : true, // raw events /** * @event click * The raw click event for the entire grid. + * @param {Roo.bootstrap.menu.Item} this * @param {Roo.EventObject} e */ - click : true + "click" : true }); }; Roo.extend(Roo.bootstrap.menu.Item, Roo.bootstrap.Component, { - submenu : false, - href : '', - html : '', - preventDefault: true, - disable : false, + href : false, + html : false, + preventDefault: false, + isContainer : false, active : false, - fa : false, - pos : 'right', + fa: false, - isContainer : false, // ?? only a <li drowdonw-menu-item"> - - getAutoCreate : function() - { + getAutoCreate : function(){ if(this.isContainer){ return { @@ -68,17 +51,15 @@ cls: 'dropdown-menu-item ' }; } - var ctag = { tag: 'span', - cls : 'roo-menu-item-text', - html : this.html + html: 'Link' }; var anc = { tag : 'a', cls : 'dropdown-item', - href : this.href || '#', + href : '#', cn : [ ] }; @@ -104,65 +85,45 @@ cfg.cls += ' active'; } - if(this.disabled){ - cfg.cls += ' disabled' - } - if(this.submenu){ - cfg.cls += 'dropdown-submenu'; - if(this.pos == 'left'){ - cfg.cls += ' pull-left'; - } - } anc.href = this.href || cfg.cn[0].href ; ctag.html = this.html || cfg.cn[0].html ; return cfg; - - }, - initEvents : function() + 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)); } - this.el.on('mouseover', this.onMouseOver, this); - this.el.on('mouseout', this.onMouseOut, this); - - this.el.select('a', true).first().on('click', this.onClick, this); }, - onClick : function(e) { + Roo.log('item on click '); + if(this.preventDefault){ e.preventDefault(); } + //this.parent().hideMenuItems(); - this.fireEvent("click", this, e); + this.fireEvent('click', this, e); }, - - onMouseOver : function(e) + getEl : function() { - if(this.submenu && this.pos == 'left'){ - this.el.select('ul.dropdown-menu', true).first().setLeft(this.el.select('ul.dropdown-menu', true).first().getWidth() * -1); - } - - this.fireEvent("mouseover", this, e); - }, - - onMouseOut : function(e) - { - this.fireEvent("mouseout", this, e); + return this.el; } }); + + \ No newline at end of file