Clicking the active tool toggles it off and resets to default tool. Added some error handling in getStudyMetadata.
This commit is contained in:
parent
86c8a32e2a
commit
a647666bf3
@ -113,10 +113,18 @@ Template.toolbar.events({
|
|||||||
$(e.currentTarget).tooltip('hide');
|
$(e.currentTarget).tooltip('hide');
|
||||||
|
|
||||||
var tool = e.currentTarget.id;
|
var tool = e.currentTarget.id;
|
||||||
console.log('Setting active tool to: ' + tool);
|
|
||||||
|
|
||||||
var elements = $('.imageViewerViewport');
|
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) {
|
'click .imageViewerCommand': function(e) {
|
||||||
$(e.currentTarget).tooltip('hide');
|
$(e.currentTarget).tooltip('hide');
|
||||||
|
|||||||
@ -42,6 +42,10 @@ getStudyMetadata = function(studyInstanceUid, doneCallback) {
|
|||||||
// If no study metadata is in the cache variable, we need to retrieve it from
|
// If no study metadata is in the cache variable, we need to retrieve it from
|
||||||
// the server with a call.
|
// the server with a call.
|
||||||
Meteor.call('GetStudyMetadata', studyInstanceUid, function(error, study) {
|
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
|
// Once we have retrieved the data, we sort the series' by series
|
||||||
// and instance number in ascending order
|
// and instance number in ascending order
|
||||||
sortStudy(study);
|
sortStudy(study);
|
||||||
@ -108,6 +112,10 @@ switchToTab = function(contentId) {
|
|||||||
studies: [study]
|
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
|
// Remove the loading text template that is inside the tab container by default
|
||||||
container.innerHTML = "";
|
container.innerHTML = "";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user