🔧 Allow for menu.popup({})
This commit is contained in:
parent
9e660b1d32
commit
3719ee0b53
1 changed files with 10 additions and 2 deletions
|
@ -45,6 +45,7 @@ Menu.prototype._init = function () {
|
|||
|
||||
Menu.prototype.popup = function (window, x, y, positioningItem) {
|
||||
let [newX, newY, newPosition, newWindow] = [x, y, positioningItem, window]
|
||||
let opts
|
||||
|
||||
// menu.popup(x, y, positioningItem)
|
||||
if (!window) {
|
||||
|
@ -54,9 +55,16 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
|||
}
|
||||
}
|
||||
|
||||
// menu.popup({})
|
||||
if (window && typeof window === 'object' && window.constructor &&
|
||||
window.constructor.name !== 'BrowserWindow') {
|
||||
opts = window
|
||||
// menu.popup(window, {})
|
||||
if (x && typeof x === 'object') {
|
||||
const opts = x
|
||||
} else if (x && typeof x === 'object') {
|
||||
opts = x
|
||||
}
|
||||
|
||||
if (opts) {
|
||||
newX = opts.x
|
||||
newY = opts.y
|
||||
newPosition = opts.positioningItem
|
||||
|
|
Loading…
Reference in a new issue