LT-390: Delete measurement dialog now accepts keyboard input
This commit is contained in:
parent
19b32e8f90
commit
2e6c8245d8
@ -59,3 +59,24 @@ Template.dialogForm.onRendered(() => {
|
|||||||
OHIF.ui.repositionDialog($modal, position.x, position.y);
|
OHIF.ui.repositionDialog($modal, position.x, position.y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.dialogForm.events({
|
||||||
|
'keydown'(event) {
|
||||||
|
const instance = Template.instance(),
|
||||||
|
keyCode = event.keyCode || event.which;
|
||||||
|
|
||||||
|
let handled = false;
|
||||||
|
|
||||||
|
if(keyCode === 27) {
|
||||||
|
instance.$('.btn.btn-cancel').click();
|
||||||
|
handled = true;
|
||||||
|
} else if(keyCode === 13) {
|
||||||
|
instance.$('.btn.btn-confirm').click();
|
||||||
|
handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(handled) {
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user