Skip to content

Commit

Permalink
Access function in methodInBrowserWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Jun 21, 2016
1 parent 35097b2 commit 3505e98
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/browser/api/menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ const MenuItem = (function () {
const methodName = rolesMap[this.role]
if (methodInApp[methodName]) {
return app[methodName]()
} else if (typeof methodInBrowserWindow[methodName] === 'function') {
return methodInBrowserWindow[methodName](focusedWindow)
} else if (methodInBrowserWindow[methodName]) {
if (typeof methodName === 'function') {
return methodName(focusedWindow)
} else {
return focusedWindow[methodName]()
}
return focusedWindow[methodName]()
} else {
const {webContents} = focusedWindow
return webContents != null ? webContents[methodName]() : void 0
Expand Down

0 comments on commit 3505e98

Please sign in to comment.