Add default label/accelerator to role menu items
This commit is contained in:
parent
25b2724ab9
commit
13a6d32ee9
2 changed files with 17 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
const roles = {
|
||||
undo: {
|
||||
label: 'Undo',
|
||||
accelerator: 'CmdOrCtrl+Z',
|
||||
|
@ -63,3 +63,15 @@ module.exports = {
|
|||
method: 'toggleFullScreen'
|
||||
}
|
||||
}
|
||||
|
||||
exports.getDefaultLabel = function (role) {
|
||||
if (roles.hasOwnProperty(role)) {
|
||||
return roles[role].label
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
exports.getDefaultAccelerator = function (role) {
|
||||
if (roles.hasOwnProperty(role)) return roles[role].accelerator
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue