Skip to content

Commit bcef6eb

Browse files
brencazcbenz
authored andcommitted
document menu closed event and fix styling issue
1 parent c586806 commit bcef6eb

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

atom/browser/api/atom_api_web_contents.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,9 @@ void WebContents::RendererResponsive(content::WebContents* source) {
653653

654654
bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) {
655655
if (params.custom_context.is_pepper_menu) {
656-
Emit("pepper-context-menu",
657-
std::make_pair(params, web_contents()),
658-
base::Bind(&content::WebContents::NotifyContextMenuClosed,
659-
base::Unretained(web_contents()), params.custom_context));
656+
Emit("pepper-context-menu", std::make_pair(params, web_contents()),
657+
base::Bind(&content::WebContents::NotifyContextMenuClosed,
658+
base::Unretained(web_contents()), params.custom_context));
660659
} else {
661660
Emit("context-menu", std::make_pair(params, web_contents()));
662661
}

docs/api/menu.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ A `MenuItem[]` array containing the menu's items.
109109
Each `Menu` consists of multiple [`MenuItem`](menu-item.md)s and each `MenuItem`
110110
can have a submenu.
111111

112+
### Instance Events
113+
114+
Objects created with `new Menu` or returned by `Menu.buildFromTemplate` emit
115+
the following events:
116+
117+
#### Event: 'closed'
118+
119+
Emitted when the menu is closed.
120+
112121
## Examples
113122

114123
The `Menu` class is only available in the main process, but you can also use it

0 commit comments

Comments
 (0)