remove quotes and const replaces

This commit is contained in:
Shelley Vohr 2017-10-25 10:17:41 -04:00
parent 135454342d
commit ffd43c1886
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -35,8 +35,8 @@ Menu.prototype._init = function () {
},
menuWillShow: () => {
// Ensure radio groups have at least one menu item seleted
for (let id in this.groupsMap) {
let found = this.groupsMap[id].find(item => item.checked) || null
for (const id in this.groupsMap) {
const found = this.groupsMap[id].find(item => item.checked) || null
if (!found) v8Util.setHiddenValue(this.groupsMap[id][0], 'checked', true)
}
}
@ -222,11 +222,11 @@ function indexToInsertByPosition (items, position) {
// compute new index based on query
const queries = {
'after': (index) => {
after: (index) => {
index += 1
return index
},
'endof': (index) => {
endof: (index) => {
if (index === -1) {
items.push({id, type: 'separator'})
index = items.length - 1
@ -245,11 +245,11 @@ function indexToInsertByPosition (items, position) {
// insert a new MenuItem depending on its type
function insertItemByType (item, pos) {
const types = {
'normal': () => this.insertItem(pos, item.commandId, item.label),
'checkbox': () => this.insertCheckItem(pos, item.commandId, item.label),
'separator': () => this.insertSeparator(pos),
'submenu': () => this.insertSubMenu(pos, item.commandId, item.label, item.submenu),
'radio': () => {
normal: () => this.insertItem(pos, item.commandId, item.label),
checkbox: () => this.insertCheckItem(pos, item.commandId, item.label),
separator: () => this.insertSeparator(pos),
submenu: () => this.insertSubMenu(pos, item.commandId, item.label, item.submenu),
radio: () => {
// Grouping radio menu items
item.overrideReadOnlyProperty('groupId', generateGroupId(this.items, pos))
if (this.groupsMap[item.groupId] == null) {