/ext-4.0.7/src/menu/Separator.js

https://bitbucket.org/srogerf/javascript · JavaScript · 126 lines · 16 code · 21 blank · 89 comment · 0 complexity · 13c1269aea71c1a1f155980e5168748f MD5 · raw file

  1. /*
  2. This file is part of Ext JS 4
  3. Copyright (c) 2011 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. GNU General Public License Usage
  6. 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.
  7. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
  8. */
  9. /**
  10. * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will
  11. * add one of these by using "-" in your call to add() or in your items config rather than creating one directly.
  12. *
  13. * @example
  14. * Ext.create('Ext.menu.Menu', {
  15. * width: 100,
  16. * height: 100,
  17. * floating: false, // usually you want this set to True (default)
  18. * renderTo: Ext.getBody(), // usually rendered by it's containing component
  19. * items: [{
  20. * text: 'icon item',
  21. * iconCls: 'add16'
  22. * },{
  23. * xtype: 'menuseparator'
  24. * },{
  25. * text: 'seperator above',
  26. * },{
  27. * text: 'regular item',
  28. * }]
  29. * });
  30. */
  31. Ext.define('Ext.menu.Separator', {
  32. extend: 'Ext.menu.Item',
  33. alias: 'widget.menuseparator',
  34. /**
  35. * @cfg {String} activeCls @hide
  36. */
  37. /**
  38. * @cfg {Boolean} canActivate @hide
  39. */
  40. canActivate: false,
  41. /**
  42. * @cfg {Boolean} clickHideDelay @hide
  43. */
  44. /**
  45. * @cfg {Boolean} destroyMenu @hide
  46. */
  47. /**
  48. * @cfg {Boolean} disabledCls @hide
  49. */
  50. focusable: false,
  51. /**
  52. * @cfg {String} href @hide
  53. */
  54. /**
  55. * @cfg {String} hrefTarget @hide
  56. */
  57. /**
  58. * @cfg {Boolean} hideOnClick @hide
  59. */
  60. hideOnClick: false,
  61. /**
  62. * @cfg {String} icon @hide
  63. */
  64. /**
  65. * @cfg {String} iconCls @hide
  66. */
  67. /**
  68. * @cfg {Object} menu @hide
  69. */
  70. /**
  71. * @cfg {String} menuAlign @hide
  72. */
  73. /**
  74. * @cfg {Number} menuExpandDelay @hide
  75. */
  76. /**
  77. * @cfg {Number} menuHideDelay @hide
  78. */
  79. /**
  80. * @cfg {Boolean} plain @hide
  81. */
  82. plain: true,
  83. /**
  84. * @cfg {String} separatorCls
  85. * The CSS class used by the separator item to show the incised line.
  86. * Defaults to `Ext.baseCSSPrefix + 'menu-item-separator'`.
  87. */
  88. separatorCls: Ext.baseCSSPrefix + 'menu-item-separator',
  89. /**
  90. * @cfg {String} text @hide
  91. */
  92. text: ' ',
  93. onRender: function(ct, pos) {
  94. var me = this,
  95. sepCls = me.separatorCls;
  96. me.cls += ' ' + sepCls;
  97. me.callParent(arguments);
  98. }
  99. });