initial import
[roojs1] / Roo / menu / Separator.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11
12 /**
13  * @class Roo.menu.Separator
14  * @extends Roo.menu.BaseItem
15  * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will
16  * add one of these by using "-" in you call to add() or in your items config rather than creating one directly.
17  * @constructor
18  * @param {Object} config Configuration options
19  */
20 Roo.menu.Separator = function(config){
21     Roo.menu.Separator.superclass.constructor.call(this, config);
22 };
23
24 Roo.extend(Roo.menu.Separator, Roo.menu.BaseItem, {
25     /**
26      * @cfg {String} itemCls The default CSS class to use for separators (defaults to "x-menu-sep")
27      */
28     itemCls : "x-menu-sep",
29     /**
30      * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
31      */
32     hideOnClick : false,
33
34     // private
35     onRender : function(li){
36         var s = document.createElement("span");
37         s.className = this.itemCls;
38         s.innerHTML = "&#160;";
39         this.el = s;
40         li.addClass("x-menu-sep-li");
41         Roo.menu.Separator.superclass.onRender.apply(this, arguments);
42     }
43 });