Fixes for keydown event detection for dialogs. Updated cornerstoneTools to latest master

This commit is contained in:
Erik Ziegler committed 2016-01-09 18:41:33 +01:00
1 parent 8afcb1a1a9
commit 44491c639d
12 files changed
+65 -37

No files matched your search

@@ -4,6 +4,9 @@ function closeHandler(dialog) {
// Remove the backdrop
$(".removableBackdrop").remove();
// Restore the focus to the active viewport
setFocusToActiveViewport();
}
changeNonTargetResponse = function(measurementData, eventData, doneCallback) {
@@ -55,6 +58,7 @@ changeNonTargetResponse = function(measurementData, eventData, doneCallback) {
}
dialog.css(dialogProperty);
dialog.focus();
var measurement = Measurements.findOne(measurementData.id);
if (!measurement) {
@@ -136,9 +140,10 @@ Template.nonTargetResponseDialog.events({
'keydown #nonTargetResponseDialog': function(e) {
var dialog = Template.nonTargetResponseDialog.dialog;
// If Enter is pressed, close the dialog
if (e.which === 13) {
// If Esc or Enter are pressed, close the dialog
if (e.which === keys.ESC || e.which === keys.ENTER) {
closeHandler(dialog);
return false;
}
}
});