Add Menu.closePopup API on macOS
This commit is contained in:
parent
947556a23f
commit
6a023dc4fe
8 changed files with 48 additions and 11 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue