Default to focused window whenever param is null/undefined
This commit is contained in:
parent
3e05350d6b
commit
c951e253c6
1 changed files with 4 additions and 1 deletions
|
@ -152,7 +152,7 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
|||
positioningItem = y
|
||||
y = x
|
||||
x = window
|
||||
window = BrowserWindow.getFocusedWindow()
|
||||
window = null
|
||||
}
|
||||
|
||||
// menu.popup(window, {})
|
||||
|
@ -164,6 +164,9 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
|||
asyncPopup = options.async
|
||||
}
|
||||
|
||||
// Default to showing in focused window.
|
||||
if (window == null) window = BrowserWindow.getFocusedWindow()
|
||||
|
||||
// Default to showing under mouse location.
|
||||
if (typeof x !== 'number') x = -1
|
||||
if (typeof y !== 'number') y = -1
|
||||
|
|
Loading…
Reference in a new issue