forked from KillerCodeMonkey/angularjs-electron-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.js
27 lines (25 loc) · 715 Bytes
/
menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var remote = require('electron').remote
var {MenuItem, Menu} = require('electron').remote
//var MenuItem = require('electron')
// Build our new menu
var menu = new Menu()
menu.append(new MenuItem({
label: 'Delete',
click: function() {
// Trigger an alert when menu item is clicked
alert('Deleted')
}
}))
menu.append(new MenuItem({
label: 'More Info...',
click: function() {
// Trigger an alert when menu item is clicked
alert('Here is more information')
}
}))
// Add the listener
/*document.addEventListener('DOMContentLoaded', function () {
document.querySelector('.js-context-menu').addEventListener('click', function (event) {
menu.popup(remote.getCurrentWindow());
})
})*/