mirror of
https://github.com/electron/electron.git
synced 2026-01-28 08:48:14 -05:00
add conditional for menu.popup(window, callback)
This commit is contained in:
@@ -58,8 +58,9 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
||||
callback = newPosition
|
||||
}
|
||||
|
||||
// menu.popup({})
|
||||
if (window != null && window.constructor === Object) {
|
||||
// menu.popup({}) || menu.popup(window, callback)
|
||||
if ((window != null && window.constructor === Object) ||
|
||||
(x && typeof x === 'function')) {
|
||||
opts = window
|
||||
callback = arguments[1]
|
||||
// menu.popup(window, {})
|
||||
|
||||
Reference in New Issue
Block a user