Saving the hotkeys definitions

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2017-06-14 09:19:49 +02:00
1 parent 20f274962b
commit a77838d550
3 files changed
+13 -2

No files matched your search

@@ -7,6 +7,15 @@ import { OHIF } from 'meteor/ohif:core';
Template.hotkeysForm.onCreated(() => {
const instance = Template.instance();
instance.api = {
save() {
const { contextName } = instance.data;
const form = instance.$('form').first().data('component');
const definitions = form.value();
OHIF.hotkeys.store(contextName, definitions);
}
};
const rg = (start, end) => _.range(start, end + 1);
instance.allowedKeys = _.union(rg(32, 40), rg(48, 57), rg(65, 90), rg(112, 121), [123]);