commit extjs-2.2.1
[extjs.git] / source / widgets / menu / ColorItem.js
1 /*\r
2  * Ext JS Library 2.2.1\r
3  * Copyright(c) 2006-2009, Ext JS, LLC.\r
4  * licensing@extjs.com\r
5  * \r
6  * http://extjs.com/license\r
7  */\r
8 \r
9 /**\r
10  * @class Ext.menu.ColorItem\r
11  * @extends Ext.menu.Adapter\r
12  * A menu item that wraps the {@link Ext.ColorPalette} component.\r
13  * @constructor\r
14  * Creates a new ColorItem\r
15  * @param {Object} config Configuration options\r
16  */\r
17 Ext.menu.ColorItem = function(config){\r
18     Ext.menu.ColorItem.superclass.constructor.call(this, new Ext.ColorPalette(config), config);\r
19     /** The Ext.ColorPalette object @type Ext.ColorPalette */\r
20     this.palette = this.component;\r
21     this.relayEvents(this.palette, ["select"]);\r
22     if(this.selectHandler){\r
23         this.on('select', this.selectHandler, this.scope);\r
24     }\r
25 };\r
26 Ext.extend(Ext.menu.ColorItem, Ext.menu.Adapter);