Don't popup context menu with no items, fixes #2032.

On OS X popuping an empty context menu would have no effect but on Linux
an empty menu container would still be showed.
This commit is contained in:
Cheng Zhao 2014-05-20 22:34:37 +08:00
parent 0ad26c337a
commit 6fa6863244

View File

@ -98,5 +98,6 @@ class ContextMenuManager
showForEvent: (event) ->
@activeElement = event.target
menuTemplate = @combinedMenuTemplateForElement(event.target)
return unless menuTemplate?.length > 0
@executeBuildHandlers(event, menuTemplate)
remote.getCurrentWindow().emit('context-menu', menuTemplate)