Make callback work for old-style Menu.popup call
While the old-style Menu.popup has been deprecated, it is still being used widely in apps and even in Electron itself.
This commit is contained in:
parent
2ec3b8ce76
commit
73d78d345a
2 changed files with 10 additions and 0 deletions
|
@ -56,6 +56,11 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
|||
[newPosition, newY, newX, newWindow] = [y, x, window, null]
|
||||
}
|
||||
|
||||
// menu.popup([w], x, y, callback)
|
||||
if (typeof newPosition === 'function') {
|
||||
callback = newPosition
|
||||
}
|
||||
|
||||
// menu.popup({})
|
||||
if (window != null && window.constructor === Object) {
|
||||
opts = window
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue