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

@@ -1,5 +1,5 @@
<template name="nonTargetLesionDialog">
<div id="nonTargetLesionLocationDialog">
<div id="nonTargetLesionLocationDialog" tabindex="0">
<div class="dialogHeader">
<h4>Select Lesion Location</h4>
</div>
@@ -32,7 +32,7 @@
</div>
</div>
<div id="nonTargetLesionRelabelDialog">
<div id="nonTargetLesionRelabelDialog" tabindex="0">
<div class="dialogHeader">
<h4>Select Lesion Location</h4>
</div>
@@ -4,6 +4,9 @@ function closeHandler(dialog) {
// Remove the backdrop
$(".removableBackdrop").remove();
// Restore the focus to the active viewport
setFocusToActiveViewport();
}
// This event sets lesion number for new lesion
@@ -168,6 +171,7 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
}
dialog.css(dialogProperty);
dialog.focus();
var measurement = Measurements.findOne(measurementData.id);
if (!measurement) {
@@ -311,9 +315,10 @@ Template.nonTargetLesionDialog.events({
'keydown #lesionLocationDialog, keydown #lesionLocationRelabelDialog': function(e) {
var dialog = Template.nonTargetLesionDialog.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;
}
}
});