X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/b37ceabb82336ee82757cd32efe353cfab8ec267..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/pkgs/pkg-buttons-debug.js diff --git a/pkgs/pkg-buttons-debug.js b/pkgs/pkg-buttons-debug.js index b1dd849d..e734062d 100644 --- a/pkgs/pkg-buttons-debug.js +++ b/pkgs/pkg-buttons-debug.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.2.2 - * 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 @@ -194,6 +194,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( @@ -256,8 +261,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; @@ -624,9 +630,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(); } @@ -637,6 +641,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){ @@ -926,9 +937,7 @@ Ext.SplitButton = Ext.extend(Ext.Button, { this.arrowHandler.call(this.scope || this, this, e); } }else{ - if(this.enableToggle){ - this.toggle(); - } + this.doToggle(); this.fireEvent("click", this, e); if(this.handler){ this.handler.call(this.scope || this, this, e);