From 23b235c9c73bc8db956e06d3d612ec555caee4ad Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 20 Mar 2017 20:24:01 -0700 Subject: [PATCH] Default async to false when object is specified --- lib/browser/api/menu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index 9615962ac66b..99d650d773d3 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -144,7 +144,7 @@ Menu.prototype._init = function () { } Menu.prototype.popup = function (window, x, y, positioningItem) { - let asyncPopup = false + let asyncPopup // menu.popup(x, y, positioningItem) if (window != null && (typeof window !== 'object' || window.constructor !== BrowserWindow)) { @@ -174,6 +174,9 @@ Menu.prototype.popup = function (window, x, y, positioningItem) { // Default to not highlighting any item. if (typeof positioningItem !== 'number') positioningItem = -1 + // Default to synchronous for backwards compatibility. + if (typeof asyncPopup !== 'boolean') asyncPopup = false + this.popupAt(window, x, y, positioningItem, asyncPopup) }