add conditional for menu.popup(window, callback)

This commit is contained in:
Shelley Vohr 2018-02-19 13:06:37 -05:00
parent 55d4d74624
commit cd9e7142e4
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -58,8 +58,9 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
callback = newPosition callback = newPosition
} }
// menu.popup({}) // menu.popup({}) || menu.popup(window, callback)
if (window != null && window.constructor === Object) { if ((window != null && window.constructor === Object) ||
(x && typeof x === 'function')) {
opts = window opts = window
callback = arguments[1] callback = arguments[1]
// menu.popup(window, {}) // menu.popup(window, {})