Call role method on focused web contents
This commit is contained in:
parent
06e595e7cc
commit
f9a8bd3ea5
3 changed files with 10 additions and 16 deletions
|
@ -48,13 +48,13 @@ const MenuItem = function (options) {
|
|||
this.overrideReadOnlyProperty('commandId', ++nextCommandId)
|
||||
|
||||
const click = options.click
|
||||
this.click = (event, focusedWindow) => {
|
||||
this.click = (event, focusedWindow, focusedWebContents) => {
|
||||
// Manually flip the checked flags when clicked.
|
||||
if (this.type === 'checkbox' || this.type === 'radio') {
|
||||
this.checked = !this.checked
|
||||
}
|
||||
|
||||
if (!roles.execute(this.role, focusedWindow)) {
|
||||
if (!roles.execute(this.role, focusedWindow, focusedWebContents)) {
|
||||
if (typeof click === 'function') {
|
||||
click(this, focusedWindow, event)
|
||||
} else if (typeof this.selector === 'string' && process.platform === 'darwin') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue