commit extjs-2.2.1
[extjs.git] / source / widgets / menu / Separator.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.Separator\r
11  * @extends Ext.menu.BaseItem\r
12  * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will\r
13  * add one of these by using "-" in you call to add() or in your items config rather than creating one directly.\r
14  * @constructor\r
15  * @param {Object} config Configuration options\r
16  */\r
17 Ext.menu.Separator = function(config){\r
18     Ext.menu.Separator.superclass.constructor.call(this, config);\r
19 };\r
20 \r
21 Ext.extend(Ext.menu.Separator, Ext.menu.BaseItem, {\r
22     /**\r
23      * @cfg {String} itemCls The default CSS class to use for separators (defaults to "x-menu-sep")\r
24      */\r
25     itemCls : "x-menu-sep",\r
26     /**\r
27      * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)\r
28      */\r
29     hideOnClick : false,\r
30 \r
31     // private\r
32     onRender : function(li){\r
33         var s = document.createElement("span");\r
34         s.className = this.itemCls;\r
35         s.innerHTML = " ";\r
36         this.el = s;\r
37         li.addClass("x-menu-sep-li");\r
38         Ext.menu.Separator.superclass.onRender.apply(this, arguments);\r
39     }\r
40 });