diff --git a/lib/main-menu.js b/lib/main-menu.js index dc2735514..6c2397713 100644 --- a/lib/main-menu.js +++ b/lib/main-menu.js @@ -3,11 +3,11 @@ const BrowserWindow = electron.BrowserWindow const shell = electron.shell const mainWindow = require('./main-window') -const OSX = process.platform === 'darwin' +const macOS = process.platform === 'darwin' // const WIN = process.platform === 'win32' const LINUX = process.platform === 'linux' -var boost = OSX +const boost = macOS ? { label: 'Boostnote', submenu: [ @@ -36,6 +36,7 @@ var boost = OSX type: 'separator' }, { + label: 'Quit Boostnote', role: 'quit' } ] @@ -49,13 +50,13 @@ var boost = OSX ] } -var file = { +const file = { label: 'File', submenu: [ { label: 'New Note', accelerator: 'CommandOrControl+N', - click: function () { + click () { mainWindow.webContents.send('top:new-note') } }, @@ -93,8 +94,8 @@ var file = { }, { label: 'Delete Note', - accelerator: OSX ? 'Control+Backspace' : 'Control+Delete', - click: function () { + accelerator: macOS ? 'Control+Backspace' : 'Control+Delete', + click () { mainWindow.webContents.send('detail:delete') } } @@ -104,13 +105,12 @@ var file = { if (LINUX) { file.submenu.push({ type: 'separator' - }) - file.submenu.push({ + }, { role: 'quit' }) } -var edit = { +const edit = { label: 'Edit', submenu: [ { @@ -149,20 +149,20 @@ var edit = { ] } -var view = { +const view = { label: 'View', submenu: [ { label: 'Reload', accelerator: 'CommandOrControl+R', - click: function () { + click () { BrowserWindow.getFocusedWindow().reload() } }, { label: 'Toggle Developer Tools', - accelerator: OSX ? 'Command+Alt+I' : 'Control+Shift+I', - click: function () { + accelerator: macOS ? 'Command+Alt+I' : 'Control+Shift+I', + click () { BrowserWindow.getFocusedWindow().toggleDevTools() } }, @@ -203,7 +203,7 @@ var view = { ] } -var window = { +const window = { label: 'Window', submenu: [ { @@ -226,21 +226,21 @@ var window = { ] } -var help = { +const help = { label: 'Help', role: 'help', submenu: [ { label: 'Boostnote official site', - click: function () { shell.openExternal('https://boostnote.io/') } + click () { shell.openExternal('https://boostnote.io/') } }, { label: 'Issue Tracker', - click: function () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') } + click () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') } }, { label: 'Changelog', - click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases') } + click () { shell.openExternal('https://github.com/BoostIO/boost-releases') } } ] }