smon/static/js/datapoint_edit.mjs
2024-05-25 15:00:01 +02:00

20 lines
380 B
JavaScript

export class UI {
constructor() {
document.addEventListener('keydown', evt=>this.keyHandler(evt))
document.querySelector('input[name="group"]').focus()
}
keyHandler(evt) {
if (!(evt.altKey && evt.shiftKey))
return
evt.preventDefault()
evt.stopPropagation()
switch (evt.key) {
case 'S':
document.getElementById('form-trigger').submit()
break
}
}
}