Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / src / menu / Separator.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will
17  * add one of these by using "-" in your call to add() or in your items config rather than creating one directly.
18  *
19  *     @example
20  *     Ext.create('Ext.menu.Menu', {
21  *         width: 100,
22  *         height: 100,
23  *         floating: false,  // usually you want this set to True (default)
24  *         renderTo: Ext.getBody(),  // usually rendered by it's containing component
25  *         items: [{
26  *             text: 'icon item',
27  *             iconCls: 'add16'
28  *         },{
29  *             xtype: 'menuseparator'
30  *         },{
31  *            text: 'seperator above',
32  *         },{
33  *            text: 'regular item',
34  *         }]
35  *     });
36  */
37 Ext.define('Ext.menu.Separator', {
38     extend: 'Ext.menu.Item',
39     alias: 'widget.menuseparator',
40
41     /**
42      * @cfg {String} activeCls @hide
43      */
44
45     /**
46      * @cfg {Boolean} canActivate @hide
47      */
48     canActivate: false,
49
50     /**
51      * @cfg {Boolean} clickHideDelay @hide
52      */
53
54     /**
55      * @cfg {Boolean} destroyMenu @hide
56      */
57
58     /**
59      * @cfg {Boolean} disabledCls @hide
60      */
61
62     focusable: false,
63
64     /**
65      * @cfg {String} href @hide
66      */
67
68     /**
69      * @cfg {String} hrefTarget @hide
70      */
71
72     /**
73      * @cfg {Boolean} hideOnClick @hide
74      */
75     hideOnClick: false,
76
77     /**
78      * @cfg {String} icon @hide
79      */
80
81     /**
82      * @cfg {String} iconCls @hide
83      */
84
85     /**
86      * @cfg {Object} menu @hide
87      */
88
89     /**
90      * @cfg {String} menuAlign @hide
91      */
92
93     /**
94      * @cfg {Number} menuExpandDelay @hide
95      */
96
97     /**
98      * @cfg {Number} menuHideDelay @hide
99      */
100
101     /**
102      * @cfg {Boolean} plain @hide
103      */
104     plain: true,
105
106     /**
107      * @cfg {String} separatorCls
108      * The CSS class used by the separator item to show the incised line.
109      * Defaults to `Ext.baseCSSPrefix + 'menu-item-separator'`.
110      */
111     separatorCls: Ext.baseCSSPrefix + 'menu-item-separator',
112
113     /**
114      * @cfg {String} text @hide
115      */
116     text: ' ',
117
118     onRender: function(ct, pos) {
119         var me = this,
120             sepCls = me.separatorCls;
121
122         me.cls += ' ' + sepCls;
123
124         me.callParent(arguments);
125     }
126 });