LT-115: Disable/Enable CRUNEX button for active image viewer

This commit is contained in:
Aysel Afsar 2016-03-07 09:05:59 -05:00
parent 4c02a1ea3f
commit 58d145194a
4 changed files with 24 additions and 3 deletions

View File

@ -32,4 +32,16 @@ pixelSpacingAutorunCheck = function() {
// Enable Lesion Buttons
oncologyTools.prop('disabled', false);
}
// Set disabled/enabled timepoint buttons
var imageId = enabledElement.image.imageId;
var study = cornerstoneTools.metaData.get('study', imageId);
// Find the relevant timepoint given the current study
var timepoint = Timepoints.findOne({
studyInstanceUids: {
$in: [study.studyInstanceUid]
}
});
setTimepointTools(timepoint);
};

View File

@ -3,14 +3,19 @@ setTimepointTools = function(timepoint) {
// Enabled tools for only follow-up tools
var fuTools = ["button#crunexTools"];
var fuToolsJQ = $("button#crunexTools");
var isDisabled = false;
if ((timepoint.timepointType).toLowerCase() === "baseline") {
// Set active tool as lesion tool
toolManager.setActiveTool('bidirectional');
toolManager.addDisabledTool({tools: fuTools, status: true});
isDisabled = true;
} else {
toolManager.setActiveTool(toolManager.getDefaultTool());
toolManager.addDisabledTool({tools: fuTools, status: false});
isDisabled = false;
}
toolManager.addDisabledTool({tools: fuTools, status: isDisabled});
fuToolsJQ.prop('disabled', isDisabled);
};
timepointAutoCheck = function(templateData) {

View File

@ -158,7 +158,7 @@ Template.toolbar.onRendered(function() {
var extraTooltipButtons = $('[rel="tooltip"]');
extraTooltipButtons.tooltip(OHIF.viewer.tooltipConfig);
// Set disabled/enabled tool buttons
// Set disabled/enabled tool buttons that are set in toolManager
setButtonsDisability();
});

View File

@ -1,4 +1,8 @@
#toolbarGroupButton
button
&.active, &:active
background-color: #3B678E
.dropdown-menu
background-color: black
border: solid 1px #333