mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Add Menu.closePopup API on macOS
This commit is contained in:
@@ -174,6 +174,15 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
||||
this.popupAt(window, x, y, positioningItem, asyncPopup)
|
||||
}
|
||||
|
||||
Menu.prototype.closePopup = function (window) {
|
||||
if (window == null || window.constructor !== BrowserWindow) {
|
||||
window = BrowserWindow.getFocusedWindow()
|
||||
}
|
||||
if (window != null) {
|
||||
this.closePopupAt(window.id)
|
||||
}
|
||||
}
|
||||
|
||||
Menu.prototype.append = function (item) {
|
||||
return this.insert(this.getItemCount(), item)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user