LT-275: Enabling measure flow on extra viewports

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:25:09 +01:00
1 parent cc8f486204
commit 18935a7131
2 files changed
+7 -9

No files matched your search

@@ -66,7 +66,7 @@ Template.viewer.onCreated(() => {
const patientId = instance.data.studies[0].patientId;
const filter = {
'patientId': patientId
patientId
};
const timepointsPromise = instance.data.timepointApi.retrieveTimepoints(filter);
@@ -132,7 +132,7 @@ Template.viewer.events({
OHIF.measurements.MeasurementHandlers.onRemoved(event, instance, eventData);
},
CornerstoneToolsMouseClick(event, instance, data) {
const element = instance.$('.imageViewerViewport')[0];
const element = event.target;
const toolState = cornerstoneTools.getToolState(element, 'bidirectional');
@@ -141,10 +141,6 @@ Template.viewer.events({
return;
}
const selectLabelCallback = (options, value, description) => {
console.warn('>>>>options, value, description', options, value, description);
};
setTimeout(() => {
for (let i = 0; i < toolState.data.length; i++) {
const toolData = toolState.data[i];
@@ -154,8 +150,7 @@ Template.viewer.events({
toolData,
element,
measurementApi: instance.data.measurementApi,
position: data.currentPoints.page,
callback: selectLabelCallback
position: data.currentPoints.page
});
break;
}
@@ -1,5 +1,6 @@
import { Template } from 'meteor/templating';
import { Blaze } from 'meteor/blaze';
import { _ } from 'meteor/underscore';
import { OHIF } from 'meteor/ohif:core';
const toolMap = {
@@ -32,7 +33,9 @@ OHIF.measurements.toggleLabelButton = options => {
hideCommon: true,
toolType: options.toolData.toolType,
doneCallback(location, description) {
options.callback(options, location, description);
if (_.isFunction(options.callback)) {
options.callback(options, location, description);
}
toolCollection.update(measurement._id, {
$set: {