LT-296: Clicking on measurement data in table activates the measurement

This commit is contained in:
Erik Ziegler committed 2016-11-15 08:29:46 +01:00
1 parent 42c938fb44
commit 80337f271e
19 files changed
+288 -307

No files matched your search

@@ -3,17 +3,22 @@ import { OHIF } from 'meteor/ohif:core';
/**
* Sets all tool data entries value for 'active' to false
* This is used to remove the active color on entire sets of tools
*
* @param element The Cornerstone element that is being used
* @param toolType The tooltype of the tools that will be deactivated
*/
OHIF.measurements.deactivateAllToolData = (element, toolType) => {
const toolData = cornerstoneTools.getToolState(element, toolType);
if (!toolData) {
return;
}
OHIF.measurements.deactivateAllToolData = () => {
const toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.toolState;
for (let i = 0; i < toolData.data.length; i++) {
toolData.data[i].active = false;
}
Object.keys(toolState).forEach(imageId => {
const toolData = toolState[imageId];
Object.keys(toolData).forEach(toolType => {
const specificToolData = toolData[toolType];
if (!specificToolData || !specificToolData.data || !specificToolData.data.length) {
return;
}
specificToolData.data.forEach(data => {
data.active = false;
});
});
})
};