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