'use strict'
-var MenuItem, methodInBrowserWindow, nextCommandId, rolesMap
-
-nextCommandId = 0
+let nextCommandId = 0
// Maps role to methods of webContents
-rolesMap = {
+const rolesMap = {
undo: 'undo',
redo: 'redo',
cut: 'cut',
}
// Maps methods that should be called directly on the BrowserWindow instance
-methodInBrowserWindow = {
+const methodInBrowserWindow = {
minimize: true,
close: true
}
quit: true
}
-MenuItem = (function () {
+const MenuItem = (function () {
MenuItem.types = ['normal', 'separator', 'submenu', 'checkbox', 'radio']
function MenuItem (options) {
- var click, ref
+ let click, ref
const {app, Menu} = require('electron')
click = options.click
this.selector = options.selector
this.commandId = ++nextCommandId
this.click = (focusedWindow) => {
// Manually flip the checked flags when clicked.
- var methodName, ref1, ref2
+ let methodName, ref1, ref2
if ((ref1 = this.type) === 'checkbox' || ref1 === 'radio') {
this.checked = !this.checked
}