From ca5f69b5c34618f1efec3579224e84d4ef641b3d Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Sun, 19 Feb 2017 01:26:34 -0700 Subject: [PATCH] Default `async` to true for popup menus; fix lint errors Fixes https://github.com/brave/browser-laptop/issues/5470 --- atom/browser/api/atom_api_menu_views.cc | 2 ++ atom/browser/api/atom_api_menu_views.h | 1 + lib/browser/api/menu.js | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_menu_views.cc b/atom/browser/api/atom_api_menu_views.cc index 59fdac3949..4399d5aee6 100644 --- a/atom/browser/api/atom_api_menu_views.cc +++ b/atom/browser/api/atom_api_menu_views.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. +#include + #include "atom/browser/api/atom_api_menu_views.h" #include "atom/browser/native_window_views.h" diff --git a/atom/browser/api/atom_api_menu_views.h b/atom/browser/api/atom_api_menu_views.h index a974f75bc7..5b519e8d4c 100644 --- a/atom/browser/api/atom_api_menu_views.h +++ b/atom/browser/api/atom_api_menu_views.h @@ -6,6 +6,7 @@ #define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_ #include +#include #include "atom/browser/api/atom_api_menu.h" #include "base/memory/weak_ptr.h" diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index 691db3b8ad..be6bc4f4e2 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 = true // menu.popup(x, y, positioningItem) if (typeof window !== 'object' || window.constructor !== BrowserWindow) { @@ -161,7 +161,9 @@ Menu.prototype.popup = function (window, x, y, positioningItem) { x = options.x y = options.y positioningItem = options.positioningItem - asyncPopup = options.async + asyncPopup = typeof options.async === 'boolean' + ? options.async + : true } // Default to showing under mouse location.