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 committed 2015-12-15 16:41:04 -05:00
1 parent 86c8a32e2a
commit a647666bf3
2 files changed
+18 -2

No files matched your search

@@ -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');