Merge pull request #6595 from lukeapage/patch-8

Clarify the default arguments for Menu popup
This commit is contained in:
Cheng Zhao 2016-07-26 11:16:57 +09:00 committed by GitHub
commit c70ec47138

View file

@ -227,16 +227,14 @@ The `menu` object has the following instance methods:
#### `menu.popup([browserWindow, x, y, positioningItem])` #### `menu.popup([browserWindow, x, y, positioningItem])`
* `browserWindow` BrowserWindow (optional) - Default is `null`. * `browserWindow` BrowserWindow (optional) - Default is `BrowserWindow.getFocusedWindow()`.
* `x` Number (optional) - Default is -1. * `x` Number (optional) - Default is the current mouse cursor position.
* `y` Number (**required** if `x` is used) - Default is -1. * `y` Number (**required** if `x` is used) - Default is the current mouse cursor position.
* `positioningItem` Number (optional) _macOS_ - The index of the menu item to * `positioningItem` Number (optional) _macOS_ - The index of the menu item to
be positioned under the mouse cursor at the specified coordinates. Default is be positioned under the mouse cursor at the specified coordinates. Default is
-1. -1.
Pops up this menu as a context menu in the `browserWindow`. You can optionally Pops up this menu as a context menu in the `browserWindow`.
provide a `x, y` coordinate to place the menu at, otherwise it will be placed
at the current mouse cursor position.
#### `menu.append(menuItem)` #### `menu.append(menuItem)`