X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/530ef4b6c5b943cfa68b779d11cf7de29aa878bf..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/docs/source/Button.html diff --git a/docs/source/Button.html b/docs/source/Button.html index 02a91e7b..d7f59050 100644 --- a/docs/source/Button.html +++ b/docs/source/Button.html @@ -7,10 +7,10 @@
/*!
- * Ext JS Library 3.2.1
- * Copyright(c) 2006-2010 Ext JS, Inc.
- * licensing@extjs.com
- * http://www.extjs.com/license
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
  */
 
/** * @class Ext.Button @@ -202,6 +202,11 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { */ initComponent : function(){ + if(this.menu){ + this.menu = Ext.menu.MenuMgr.get(this.menu); + this.menu.ownerCt = this; + } + Ext.Button.superclass.initComponent.call(this); this.addEvents( @@ -264,8 +269,9 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { */ 'menutriggerout' ); - if(this.menu){ - this.menu = Ext.menu.MenuMgr.get(this.menu); + + if (this.menu){ + this.menu.ownerCt = undefined; } if(Ext.isString(this.toggleGroup)){ this.enableToggle = true; @@ -382,9 +388,10 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { if(this.repeat){ var repeater = new Ext.util.ClickRepeater(btn, Ext.isObject(this.repeat) ? this.repeat : {}); - this.mon(repeater, 'click', this.onClick, this); + this.mon(repeater, 'click', this.onRepeatClick, this); + }else{ + this.mon(btn, this.clickEvent, this.onClick, this); } - this.mon(btn, this.clickEvent, this.onClick, this); }, // private @@ -452,7 +459,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { this.clearTip(); } if(this.menu && this.destroyMenu !== false) { - Ext.destroy(this.menu); + Ext.destroy(this.btnEl, this.menu); } Ext.destroy(this.repeater); }, @@ -616,6 +623,11 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { hasVisibleMenu : function(){ return this.menu && this.menu.ownerCt == this && this.menu.isVisible(); }, + + // private + onRepeatClick : function(repeat, e){ + this.onClick(e); + }, // private onClick : function(e){ @@ -626,9 +638,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return; } if(!this.disabled){ - if(this.enableToggle && (this.allowDepress !== false || !this.pressed)){ - this.toggle(); - } + this.doToggle(); if(this.menu && !this.hasVisibleMenu() && !this.ignoreNextClick){ this.showMenu(); } @@ -639,6 +649,13 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } } }, + + // private + doToggle: function(){ + if (this.enableToggle && (this.allowDepress !== false || !this.pressed)) { + this.toggle(); + } + }, // private isMenuTriggerOver : function(e, internal){