From bcef6eb3dfddeac81c8761fdc0e991731fffc70c Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Mon, 27 Nov 2017 21:28:30 +0100 Subject: [PATCH] document menu closed event and fix styling issue --- atom/browser/api/atom_api_web_contents.cc | 7 +++---- docs/api/menu.md | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 2a9650160a57..320741106cdb 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -653,10 +653,9 @@ void WebContents::RendererResponsive(content::WebContents* source) { bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) { if (params.custom_context.is_pepper_menu) { - Emit("pepper-context-menu", - std::make_pair(params, web_contents()), - base::Bind(&content::WebContents::NotifyContextMenuClosed, - base::Unretained(web_contents()), params.custom_context)); + Emit("pepper-context-menu", std::make_pair(params, web_contents()), + base::Bind(&content::WebContents::NotifyContextMenuClosed, + base::Unretained(web_contents()), params.custom_context)); } else { Emit("context-menu", std::make_pair(params, web_contents())); } diff --git a/docs/api/menu.md b/docs/api/menu.md index cc4922e6e4d2..e01666ef1ec8 100644 --- a/docs/api/menu.md +++ b/docs/api/menu.md @@ -109,6 +109,15 @@ A `MenuItem[]` array containing the menu's items. Each `Menu` consists of multiple [`MenuItem`](menu-item.md)s and each `MenuItem` can have a submenu. +### Instance Events + +Objects created with `new Menu` or returned by `Menu.buildFromTemplate` emit +the following events: + +#### Event: 'closed' + +Emitted when the menu is closed. + ## Examples The `Menu` class is only available in the main process, but you can also use it