Add "event" parameter for "click" handler of MenuItem
This commit is contained in:
parent
e6327fb015
commit
8d08e215b2
5 changed files with 11 additions and 9 deletions
|
@ -72,7 +72,7 @@ const MenuItem = (function () {
|
|||
throw new Error('Unknown menu type ' + this.type)
|
||||
}
|
||||
this.commandId = ++nextCommandId
|
||||
this.click = (focusedWindow) => {
|
||||
this.click = (event, focusedWindow) => {
|
||||
// Manually flip the checked flags when clicked.
|
||||
if (this.type === 'checkbox' || this.type === 'radio') {
|
||||
this.checked = !this.checked
|
||||
|
@ -91,7 +91,7 @@ const MenuItem = (function () {
|
|||
return webContents != null ? webContents[methodName]() : void 0
|
||||
}
|
||||
} else if (typeof click === 'function') {
|
||||
return click(this, focusedWindow)
|
||||
return click(this, focusedWindow, event)
|
||||
} else if (typeof this.selector === 'string' && process.platform === 'darwin') {
|
||||
return Menu.sendActionToFirstResponder(this.selector)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue