mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Fix dockMenu not being referenced in JavaScript
This commit is contained in:
@@ -10,6 +10,8 @@ const electron = require('electron')
|
||||
const {deprecate, Menu} = electron
|
||||
const {EventEmitter} = require('events')
|
||||
|
||||
let dockMenu = null
|
||||
|
||||
// App is an EventEmitter.
|
||||
Object.setPrototypeOf(App.prototype, EventEmitter.prototype)
|
||||
EventEmitter.call(app)
|
||||
@@ -49,7 +51,13 @@ if (process.platform === 'darwin') {
|
||||
hide: bindings.dockHide,
|
||||
show: bindings.dockShow,
|
||||
isVisible: bindings.dockIsVisible,
|
||||
setMenu: bindings.dockSetMenu,
|
||||
setMenu (menu) {
|
||||
dockMenu = menu
|
||||
bindings.dockSetMenu(menu)
|
||||
},
|
||||
getMenu () {
|
||||
return dockMenu
|
||||
},
|
||||
setIcon: bindings.dockSetIcon
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user