X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..530ef4b6c5b943cfa68b779d11cf7de29aa878bf:/src/widgets/ColorPalette.js diff --git a/src/widgets/ColorPalette.js b/src/widgets/ColorPalette.js index eeae4117..b4abb375 100644 --- a/src/widgets/ColorPalette.js +++ b/src/widgets/ColorPalette.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC + * Ext JS Library 3.2.1 + * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ @@ -132,7 +132,7 @@ cp.colors = ['000000', '993300', '333300']; if(this.value){ var s = this.value; this.value = null; - this.select(s); + this.select(s, true); } }, @@ -148,8 +148,9 @@ cp.colors = ['000000', '993300', '333300']; /** * Selects the specified color in the palette (fires the {@link #select} event) * @param {String} color A valid 6-digit color hex code (# will be stripped if included) + * @param {Boolean} suppressEvent (optional) True to stop the select event from firing. Defaults to false. */ - select : function(color){ + select : function(color, suppressEvent){ color = color.replace('#', ''); if(color != this.value || this.allowReselect){ var el = this.el; @@ -158,7 +159,9 @@ cp.colors = ['000000', '993300', '333300']; } el.child('a.color-'+color).addClass('x-color-palette-sel'); this.value = color; - this.fireEvent('select', this, color); + if(suppressEvent !== true){ + this.fireEvent('select', this, color); + } } } @@ -166,4 +169,4 @@ cp.colors = ['000000', '993300', '333300']; * @cfg {String} autoEl @hide */ }); -Ext.reg('colorpalette', Ext.ColorPalette); +Ext.reg('colorpalette', Ext.ColorPalette); \ No newline at end of file