Remove the closed event of Menu

The callback of Menu.popup does more things, and there is actually no
request for the closed event.
This commit is contained in:
Cheng Zhao 2018-01-01 17:22:07 +09:00
parent 73d78d345a
commit 46330ac2a9
6 changed files with 1 additions and 50 deletions

View file

@ -280,8 +280,7 @@ WebContents.prototype._init = function () {
this.on('pepper-context-menu', function (event, params, callback) {
// Access Menu via electron.Menu to prevent circular require.
const menu = electron.Menu.buildFromTemplate(params.menu)
menu.once('closed', callback)
menu.popup(event.sender.getOwnerBrowserWindow(), params.x, params.y)
menu.popup(event.sender.getOwnerBrowserWindow(), params.x, params.y, callback)
})
// The devtools requests the webContents to reload.