Allow positioning the context menu

This commit is contained in:
Joao Moreno 2014-11-25 16:47:41 +01:00
parent 03f19bea6b
commit 46e6b5ec3e
7 changed files with 40 additions and 5 deletions

View file

@ -45,9 +45,12 @@ Menu::_init = ->
break
v8Util.setHiddenValue group[0], 'checked', true unless checked
Menu::popup = (window) ->
Menu::popup = (window, x, y) ->
throw new TypeError('Invalid window') unless window?.constructor is BrowserWindow
@_popup window
if x? and y?
@_popupAt(window, x, y)
else
@_popup window
Menu::append = (item) ->
@insert @getItemCount(), item