When calling menu item's click callback, pass the item object.

This commit is contained in:
Cheng Zhao 2013-08-14 12:51:47 +08:00
parent f267a7812f
commit 971b72c2b6
2 changed files with 5 additions and 3 deletions

View file

@ -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