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

View File

@@ -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, {})