mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
Make Menu.popup accept no parameter
This commit is contained in:
@@ -79,7 +79,11 @@ Menu::_init = ->
|
||||
v8Util.setHiddenValue group[0], 'checked', true unless checked
|
||||
|
||||
Menu::popup = (window, x, y) ->
|
||||
throw new TypeError('Invalid window') unless window?.constructor is BrowserWindow
|
||||
unless window?.constructor is BrowserWindow
|
||||
# Shift.
|
||||
y = x
|
||||
x = window
|
||||
window = BrowserWindow.getFocusedWindow()
|
||||
if x? and y?
|
||||
@_popupAt(window, x, y)
|
||||
else
|
||||
|
||||
@@ -237,9 +237,9 @@ Generally, the `template` is just an array of `options` for constructing a
|
||||
You can also attach other fields to the element of the `template` and they
|
||||
will become properties of the constructed menu items.
|
||||
|
||||
### `Menu.popup(browserWindow[, x, y])`
|
||||
### `Menu.popup([browserWindow, x, y])`
|
||||
|
||||
* `browserWindow` BrowserWindow
|
||||
* `browserWindow` BrowserWindow (optional)
|
||||
* `x` Number (optional)
|
||||
* `y` Number (**required** if `x` is used)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user