When calling menu item's click callback, pass the item object.
This commit is contained in:
parent
f267a7812f
commit
971b72c2b6
2 changed files with 5 additions and 3 deletions
|
@ -37,7 +37,9 @@ Menu::insert = (pos, item) ->
|
|||
isCommandIdEnabled: (commandId) => @commandsMap[commandId]?.enabled
|
||||
isCommandIdVisible: (commandId) => @commandsMap[commandId]?.visible
|
||||
getAcceleratorForCommandId: (commandId) => @commandsMap[commandId]?.accelerator
|
||||
executeCommand: (commandId) => @commandsMap[commandId]?.click()
|
||||
executeCommand: (commandId) =>
|
||||
activeItem = @commandsMap[commandId]
|
||||
activeItem.click(activeItem) if activeItem?
|
||||
@items.splice pos, 0, item
|
||||
@commandsMap[item.commandId] = item
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue