From d686cf77e985b129035a91b7ada79226d298b544 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 16 Feb 2017 08:34:39 -0800 Subject: [PATCH] Update menu.popup docs to take options object --- docs/api/menu.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/api/menu.md b/docs/api/menu.md index b9bdc3606481..6969c4457eb9 100644 --- a/docs/api/menu.md +++ b/docs/api/menu.md @@ -52,14 +52,20 @@ will become properties of the constructed menu items. The `menu` object has the following instance methods: -#### `menu.popup([browserWindow, x, y, positioningItem])` +#### `menu.popup([browserWindow, options])` -* `browserWindow` BrowserWindow (optional) - Default is `BrowserWindow.getFocusedWindow()`. -* `x` Number (optional) - Default is the current mouse cursor position. -* `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 - be positioned under the mouse cursor at the specified coordinates. Default is - -1. +* `browserWindow` BrowserWindow (optional) - Default is + `BrowserWindow.getFocusedWindow()`. +* `options` Object (optional) + * `x` Number (optional) - Default is the current mouse cursor position. + * `y` Number (**required** if `x` is used) - Default is the current mouse + cursor position. + * `async` Boolean (optional) - Set to `true` to have this method return + immediately called, `false` to return after the menu has been selected + or closed. Defaults to `false`. + * `positioningItem` Number (optional) _macOS_ - The index of the menu item to + be positioned under the mouse cursor at the specified coordinates. Default + is -1. Pops up this menu as a context menu in the `browserWindow`.