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
|
@ -20,9 +20,9 @@ class MenuItem
|
|||
throw new Error('Unknown menu type') if MenuItem.types.indexOf(@type) is -1
|
||||
|
||||
@commandId = ++nextCommandId
|
||||
@click = ->
|
||||
@click = =>
|
||||
if typeof click is 'function'
|
||||
click()
|
||||
click.apply this, arguments
|
||||
else if typeof selector is 'string'
|
||||
Menu.sendActionToFirstResponder selector
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue