Rename commandOptions to commandDetail on context menu items

This commit is contained in:
Nathan Sobo
2014-09-30 12:14:54 -06:00
parent f6938183cc
commit b2cc28fb5b
3 changed files with 6 additions and 6 deletions

View File

@@ -13,12 +13,12 @@ class ContextMenu
createClickHandlers: (template) ->
for item in template
if item.command
item.commandOptions ?= {}
item.commandOptions.contextCommand = true
item.commandOptions.atomWindow = @atomWindow
item.commandDetail ?= {}
item.commandDetail.contextCommand = true
item.commandDetail.atomWindow = @atomWindow
do (item) =>
item.click = =>
global.atomApplication.sendCommandToWindow(item.command, @atomWindow, item.commandOptions)
global.atomApplication.sendCommandToWindow(item.command, @atomWindow, item.commandDetail)
else if item.submenu
@createClickHandlers(item.submenu)
item

View File

@@ -162,7 +162,7 @@ class ContextMenuManager
devMode: true
created: (event) ->
{pageX, pageY} = event
@commandOptions = {x: pageX, y: pageY}
@commandDetail = {x: pageX, y: pageY}
}]
class ContextMenuItemSet

View File

@@ -44,7 +44,7 @@ normalizeLabel = (label) ->
cloneMenuItem = (item) ->
item = _.pick(item, 'type', 'label', 'command', 'submenu', 'commandOptions')
item = _.pick(item, 'type', 'label', 'command', 'submenu', 'commandDetail')
if item.submenu?
item.submenu = item.submenu.map (submenuItem) -> cloneMenuItem(submenuItem)
item