source: trunk/web/addons/job_monarch/lib/extjs-30/src/widgets/menu/ColorMenu.js @ 625

Last change on this file since 625 was 625, checked in by ramonb, 15 years ago

lib/extjs-30:

  • new ExtJS 3.0
File size: 1.7 KB
Line 
1/*!
2 * Ext JS Library 3.0.0
3 * Copyright(c) 2006-2009 Ext JS, LLC
4 * licensing@extjs.com
5 * http://www.extjs.com/license
6 */
7/**
8 * @class Ext.menu.ColorMenu
9 * @extends Ext.menu.Menu
10 * A menu containing a {@link Ext.ColorPalette} Component.
11 * @xtype colormenu
12 */
13 Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {
14    /**
15     * @cfg {Boolean} enableScrolling
16     * @hide
17     */
18    enableScrolling: false,
19   
20    /**
21     * @cfg {Boolean} hideOnClick
22     * False to continue showing the menu after a color is selected, defaults to true.
23     */
24    hideOnClick: true,
25   
26    /**
27     * @cfg {Number} maxHeight
28     * @hide
29     */
30    /**
31     * @cfg {Number} scrollIncrement
32     * @hide
33     */
34    /**
35     * @property palette
36     * @type ColorPalette
37     * The {@link Ext.ColorPalette} instance for this ColorMenu
38     */
39   
40   
41    /**
42     * @event click
43     * @hide
44     */
45   
46    /**
47     * @event itemclick
48     * @hide
49     */
50   
51    initComponent: function(){
52        Ext.apply(this, {
53            plain: true,
54            showSeparator: false,
55            items: this.palette = new Ext.ColorPalette(this.initialConfig)
56        });
57        this.palette.purgeListeners();
58        Ext.menu.ColorMenu.superclass.initComponent.call(this);
59        this.relayEvents(this.palette, ['select']);
60        this.on('select', this.menuHide, this);
61        if(this.handler){
62            this.on('select', this.handler, this.scope || this)
63        }
64    },
65
66    menuHide: function(){
67        if(this.hideOnClick){
68            this.hide(true);
69        }
70    }
71});
72Ext.reg('colormenu', Ext.menu.ColorMenu);
Note: See TracBrowser for help on using the repository browser.