diff --git a/Packages/lesiontracker/components/lesionTable/lesionTable.js b/Packages/lesiontracker/components/lesionTable/lesionTable.js index 99a485dfb..472a732f7 100644 --- a/Packages/lesiontracker/components/lesionTable/lesionTable.js +++ b/Packages/lesiontracker/components/lesionTable/lesionTable.js @@ -3,6 +3,8 @@ Timepoints = new Meteor.Collection(null); // When nonTarget lesion is added to image, insert data to lesion table function nonTargetToolAdded(e, eventData, lesionData) { + + // Set timepointID lesionData.timepointID = $(e.currentTarget).data('timepointID'); var locationUID = measurementManagerDAL.isLesionNumberAdded(lesionData); @@ -18,12 +20,17 @@ function nonTargetToolAdded(e, eventData, lesionData) { return; } }); - $("#selectNonTargetLesionLocation option").eq(locationIndex).attr("selected", "selected"); - // $("#selectNonTargetLesionLocation").attr("disabled", "disabled"); + // Select location in locations dropdown list + $("#selectNonTargetLesionLocation option").eq(locationIndex).attr("selected", "selected"); + $("#selectNonTargetLesionLocation").attr("disabled", "disabled"); + } else{ + + // If selectNonTargetLesionLocation is disabled, make it enable + $("#selectNonTargetLesionLocation").removeAttr("disabled"); } - // Save lesionData in Session to use after location and response are selected + // Save lesionData in Session to use after location and response are selected in nonTargetLesionDialog Session.set("nonTargetLesionData", lesionData); var dialogPointsOnPage = eventData.currentPoints.page; diff --git a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js index dd8f88a54..f0d1f3ec1 100644 --- a/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js +++ b/Packages/lesiontracker/components/nonTargetLesionDialog/nonTargetLesionDialog.js @@ -96,8 +96,6 @@ Template.nonTargetLesionDialog.events({ }, 'click button#nonTargetLesionOK': function() { - // Set activeModule parameters in index.html - $("#nonTargetLesionLocationDialog").modal("hide"); var lesionData = Session.get("nonTargetLesionData"); // Get selected location data @@ -108,7 +106,13 @@ Template.nonTargetLesionDialog.events({ // Get selected location data var locationObj = lesionLocationsArray[selectedLocationIndex]; lesionData.location = $("#selectNonTargetLesionLocation :selected").text(); - lesionData.measurementText = $("#selectNonTargetLesionLocationResponse").val(); + + var response = $("#selectNonTargetLesionLocationResponse").val(); + if(response === "-1") { + return; + } + $("#nonTargetLesionLocationDialog").modal("hide"); + lesionData.measurementText = response; // Select first option $("#selectNonTargetLesionLocation").val($("#selectNonTargetLesionLocation option:first").val()); @@ -119,12 +123,10 @@ Template.nonTargetLesionDialog.events({ return; } - // Adds location data to trialPatientLocations array and returns locationUID var locationUID = measurementManagerDAL.addNewLocation(locationObj); - // Linkk locationUID with activeLesionMeasurementData + // Link locationUID with activeLesionMeasurementData lesionData.locationUID = locationUID; - measurementManagerDAL.addLesionData(lesionData);