Call role method on focused web contents

This commit is contained in:
Kevin Sawicki 2016-07-13 12:18:44 -07:00
parent 06e595e7cc
commit f9a8bd3ea5
3 changed files with 10 additions and 16 deletions

View file

@ -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') {