Improved builder

This commit is contained in:
neauoire
2020-03-25 10:02:22 +09:00
parent a78e6d3d8a
commit 2387542efc
5 changed files with 11 additions and 16 deletions

View File

@@ -59,7 +59,7 @@ function Acels (client) {
return h
}
this.convert = (event) => {
const accelerator = event.key === ' ' ? 'Space' : event.key.substr(0, 1).toUpperCase() + event.key.substr(1)
const accelerator = event.key === ' ' ? 'Space' : capitalize(event.key.replace('Arrow', ''))
if ((event.ctrlKey || event.metaKey) && event.shiftKey) {
return `CmdOrCtrl+Shift+${accelerator}`
}
@@ -113,6 +113,7 @@ function Acels (client) {
this.toggle = () => {
this.el.className = this.el.className === 'hidden' ? '' : 'hidden'
}
function capitalize (s) { return s.substr(0, 1).toUpperCase() + s.substr(1) }
}
'use strict'
function Lisp (lib = {}) {