From cd9e7142e4fd2feaa4da07235befa1907cc19c0c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 19 Feb 2018 13:06:37 -0500 Subject: [PATCH] add conditional for menu.popup(window, callback) --- lib/browser/api/menu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index 102cc43d1dc6..e599cfb3c06c 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -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, {})