From b28edb970489a02e70f10dcc669e5f76c2a87d85 Mon Sep 17 00:00:00 2001 From: Evren Ozkan Date: Fri, 13 Nov 2015 14:44:17 -0500 Subject: [PATCH] NonTarget tool touch events --- .../compatibility/nonTargetTool.js | 34 +++++++++---------- .../nonTargetLesionDialog.css | 8 +++-- .../nonTargetLesionDialog.html | 2 +- .../nonTargetLesionDialog.js | 12 +++---- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Packages/lesiontracker/compatibility/nonTargetTool.js b/Packages/lesiontracker/compatibility/nonTargetTool.js index 4f3365beb..01a32d801 100644 --- a/Packages/lesiontracker/compatibility/nonTargetTool.js +++ b/Packages/lesiontracker/compatibility/nonTargetTool.js @@ -72,7 +72,7 @@ cornerstoneTools.removeToolState(mouseEventData.element, toolType, measurementData); } - config.getNonTargetLesionLocationCallback(measurementData, mouseEventData, doneCallback); + config.getNonTargetLesionLocationCallback(measurementData, mouseEventData, doneCallback); $(mouseEventData.element).on('CornerstoneToolsMouseMove', eventData, cornerstoneTools.nonTarget.mouseMoveCallback); $(mouseEventData.element).on('CornerstoneToolsMouseDown', eventData, cornerstoneTools.nonTarget.mouseDownCallback); @@ -283,14 +283,10 @@ function addNewMeasurementTouch(touchEventData) { var element = touchEventData.element; - function doneChangingTextCallback(text) { - if (text !== null) { - measurementData.text = text; - } else { - cornerstoneTools.removeToolState(element, toolType, measurementData); - } - - measurementData.active = false; + function doneCallback(lesionNumber) { + measurementData.lesionName = "Non-Target "+lesionNumber; + measurementData.lesionNumber = lesionNumber; + measurementData.active = true; cornerstone.updateImage(element); } @@ -299,6 +295,12 @@ $(element).off('CornerstoneToolsTouchDrag', cornerstoneTools.nonTargetTouch.touchMoveCallback); $(element).off('CornerstoneToolsDragStartActive', cornerstoneTools.nonTargetTouch.touchDownActivateCallback); $(element).off('CornerstoneToolsTap', cornerstoneTools.nonTargetTouch.tapCallback); + var config = cornerstoneTools.nonTarget.getConfiguration(); + + // Set lesion number and lesion name + if (measurementData.lesionName === undefined) { + config.setLesionNumberCallback(measurementData, touchEventData, doneCallback); + } cornerstone.updateImage(element); cornerstoneTools.moveNewHandleTouch(touchEventData, measurementData.handles.end, function() { @@ -309,10 +311,8 @@ cornerstoneTools.removeToolState(element, toolType, measurementData); } - var config = cornerstoneTools.nonTarget.getConfiguration(); - if (measurementData.text === undefined) { - config.getTextCallback(doneChangingTextCallback); - } + config.getNonTargetLesionLocationCallback(measurementData, touchEventData, doneCallback); + $(element).on('CornerstoneToolsTouchDrag', cornerstoneTools.nonTargetTouch.touchMoveCallback); $(element).on('CornerstoneToolsDragStartActive', cornerstoneTools.nonTargetTouch.touchDownActivateCallback); @@ -471,8 +471,8 @@ createNewMeasurement: createNewMeasurement, onImageRendered: onImageRendered, pointNearTool: pointNearTool, - toolType: toolType, - mouseDoubleClickCallback: doubleClickCallback + toolType: toolType + //mouseDoubleClickCallback: doubleClickCallback }); cornerstoneTools.nonTarget.setConfiguration(configuration); @@ -482,8 +482,8 @@ createNewMeasurement: createNewMeasurement, onImageRendered: onImageRendered, pointNearTool: pointNearTool, - toolType: toolType, - pressCallback: doubleClickCallback + toolType: toolType + // pressCallback: doubleClickCallback }); diff --git a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.css b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.css index 4ea5e85d5..3634e3d96 100644 --- a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.css +++ b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.css @@ -5,8 +5,6 @@ background: white; padding: 10px 20px 10px 20px; border-radius: 10px; - - } #selectNonTargetLesionLocation, #selectNonTargetLesionLocationResponse { @@ -26,3 +24,9 @@ .locationOK { text-align: center; } + +.btn{ + background-color: #bbb; + border: 1px solid #888; + color: #000000; +} diff --git a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.html b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.html index 8a3e76f93..381d4c6b1 100644 --- a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.html +++ b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.html @@ -28,7 +28,7 @@ diff --git a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js index b0c5c7ada..cb2d5677e 100644 --- a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js +++ b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js @@ -46,14 +46,14 @@ function getNonTargetLesionLocationCallback(measurementData, eventData, doneCall var locationName = measurementManagerDAL.getLocationName(locationUID); selectorLocation.find('option').each(function() { - if ($(this).text().trim() === locationName.trim()) { + if ($(this).text() === locationName) { // Select location in locations dropdown list - selectorLocation.find('option').eq($(this).index()).attr("selected", "selected"); + selectorLocation.find('option').eq($(this).index()).prop("selected", true); return; } }); - selectorLocation.attr("disabled", "disabled"); + selectorLocation.prop("disabled", true); } // Enable selector location @@ -159,9 +159,9 @@ LocationResponses = new Meteor.Collection(null); LocationResponses.insert( { - text: "Complete response", - code: "CR", - description: "" + text: "Complete response", + code: "CR", + description: "" } ); LocationResponses.insert(