Clicking the active tool toggles it off and resets to default tool. Added some error handling in getStudyMetadata.

This commit is contained in:
Erik Ziegler 2015-12-15 16:41:04 -05:00
parent 86c8a32e2a
commit a647666bf3
2 changed files with 18 additions and 2 deletions

View File

@ -113,10 +113,18 @@ Template.toolbar.events({
$(e.currentTarget).tooltip('hide');
var tool = e.currentTarget.id;
console.log('Setting active tool to: ' + tool);
var elements = $('.imageViewerViewport');
toolManager.setActiveTool(tool, elements);
var activeTool = toolManager.getActiveTool();
if (tool === activeTool) {
var defaultTool = toolManager.getDefaultTool();
console.log('Setting active tool to: ' + defaultTool);
toolManager.setActiveTool(defaultTool, elements);
} else {
console.log('Setting active tool to: ' + tool);
toolManager.setActiveTool(tool, elements);
}
},
'click .imageViewerCommand': function(e) {
$(e.currentTarget).tooltip('hide');

View File

@ -42,6 +42,10 @@ getStudyMetadata = function(studyInstanceUid, doneCallback) {
// If no study metadata is in the cache variable, we need to retrieve it from
// the server with a call.
Meteor.call('GetStudyMetadata', studyInstanceUid, function(error, study) {
if (error) {
log.warn(error);
return;
}
// Once we have retrieved the data, we sort the series' by series
// and instance number in ascending order
sortStudy(study);
@ -108,6 +112,10 @@ switchToTab = function(contentId) {
studies: [study]
};
if (ViewerData[contentId].studies && ViewerData[contentId].studies.length) {
data.studies = ViewerData[contentId].studies;
}
// Remove the loading text template that is inside the tab container by default
container.innerHTML = "";