X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/src/widgets/menu/BaseItem.js diff --git a/src/widgets/menu/BaseItem.js b/src/widgets/menu/BaseItem.js deleted file mode 100644 index 336ada6d..00000000 --- a/src/widgets/menu/BaseItem.js +++ /dev/null @@ -1,166 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.menu.BaseItem - * @extends Ext.Component - * The base class for all items that render into menus. BaseItem provides default rendering, activated state - * management and base configuration options shared by all menu components. - * @constructor - * Creates a new BaseItem - * @param {Object} config Configuration options - * @xtype menubaseitem - */ -Ext.menu.BaseItem = Ext.extend(Ext.Component, { - /** - * @property parentMenu - * @type Ext.menu.Menu - * The parent Menu of this Item. - */ - /** - * @cfg {Function} handler - * A function that will handle the click event of this menu item (optional). - * The handler is passed the following parameters:
b
: Iteme
: EventObjectthis
reference) in which the handler function is executed. Defaults to this menu item.
- */
- setHandler : function(handler, scope){
- if(this.handler){
- this.un("click", this.handler, this.scope);
- }
- this.on("click", this.handler = handler, this.scope = scope);
- },
-
- // private
- onClick : function(e){
- if(!this.disabled && this.fireEvent("click", this, e) !== false
- && (this.parentMenu && this.parentMenu.fireEvent("itemclick", this, e) !== false)){
- this.handleClick(e);
- }else{
- e.stopEvent();
- }
- },
-
- // private
- activate : function(){
- if(this.disabled){
- return false;
- }
- var li = this.container;
- li.addClass(this.activeClass);
- this.region = li.getRegion().adjust(2, 2, -2, -2);
- this.fireEvent("activate", this);
- return true;
- },
-
- // private
- deactivate : function(){
- this.container.removeClass(this.activeClass);
- this.fireEvent("deactivate", this);
- },
-
- // private
- shouldDeactivate : function(e){
- return !this.region || !this.region.contains(e.getPoint());
- },
-
- // private
- handleClick : function(e){
- var pm = this.parentMenu;
- if(this.hideOnClick){
- if(pm.floating){
- pm.hide.defer(this.clickHideDelay, pm, [true]);
- }else{
- pm.deactivateActive();
- }
- }
- },
-
- // private. Do nothing
- expandMenu : Ext.emptyFn,
-
- // private. Do nothing
- hideMenu : Ext.emptyFn
-});
-Ext.reg('menubaseitem', Ext.menu.BaseItem);
\ No newline at end of file