Fix context menu not working in devtools
This commit is contained in:
parent
c6634b1ea5
commit
71303d4804
1 changed files with 4 additions and 4 deletions
|
@ -27,7 +27,9 @@ convertToMenuTemplate = (items) ->
|
||||||
label: item.label
|
label: item.label
|
||||||
enabled: item.enabled
|
enabled: item.enabled
|
||||||
if item.id?
|
if item.id?
|
||||||
transformed.click = -> DevToolsAPI.contextMenuItemSelected item.id
|
transformed.click = ->
|
||||||
|
DevToolsAPI.contextMenuItemSelected item.id
|
||||||
|
DevToolsAPI.contextMenuCleared()
|
||||||
template.push transformed
|
template.push transformed
|
||||||
template
|
template
|
||||||
|
|
||||||
|
@ -37,9 +39,7 @@ createMenu = (x, y, items, document) ->
|
||||||
|
|
||||||
menu = Menu.buildFromTemplate convertToMenuTemplate(items)
|
menu = Menu.buildFromTemplate convertToMenuTemplate(items)
|
||||||
# The menu is expected to show asynchronously.
|
# The menu is expected to show asynchronously.
|
||||||
setImmediate ->
|
setTimeout -> menu.popup remote.getCurrentWindow()
|
||||||
menu.popup remote.getCurrentWindow()
|
|
||||||
DevToolsAPI.contextMenuCleared()
|
|
||||||
|
|
||||||
showFileChooserDialog = (callback) ->
|
showFileChooserDialog = (callback) ->
|
||||||
{remote} = require 'electron'
|
{remote} = require 'electron'
|
||||||
|
|
Loading…
Reference in a new issue