Tool.js 711 B

1234567891011121314151617181920212223242526272829
  1. Ext.define('saas.override.panel.Tool', {
  2. override: 'Ext.panel.Tool',
  3. initComponent: function () {
  4. var me = this;
  5. me.callParent();
  6. if (me.items) {
  7. me.on({
  8. click: 'showMenu',
  9. scope: me
  10. });
  11. }
  12. },
  13. privates: {
  14. showMenu: function () {
  15. var me = this, menu = me.menu;
  16. if (!menu) {
  17. menu = me.menu = Ext.create('Ext.menu.Menu', {
  18. width: 100,
  19. margin: '0 0 10 0',
  20. items: me.items,
  21. ownerCmp: me
  22. });
  23. }
  24. menu.showBy(me, null, [5, 0]);
  25. }
  26. }
  27. });