From ffae67dc997076640d1d7914f160736e998b4535 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Sun, 16 Jun 2019 14:08:38 -0400 Subject: [PATCH] Remove dead comments from commandsModule --- .../src/commandsModule.js | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/extensions/ohif-cornerstone-extension/src/commandsModule.js b/extensions/ohif-cornerstone-extension/src/commandsModule.js index 8eea5fe86..fea50697f 100644 --- a/extensions/ohif-cornerstone-extension/src/commandsModule.js +++ b/extensions/ohif-cornerstone-extension/src/commandsModule.js @@ -1,14 +1,6 @@ import cornerstone from 'cornerstone-core'; import cornerstoneTools from 'cornerstone-tools'; -// TODO: Just emit the tool's name? -// TODO: Let local context handle the active tool propogation to redux? - -// import { redux } from 'ohif-core'; -// import store from './../store/'; - -// const { setToolActive } = redux.actions; - const actions = { rotateViewport: ({ viewports, rotation }) => { const enabledElement = _getActiveViewportEnabledElement( @@ -85,14 +77,13 @@ const actions = { cornerstone.setViewport(enabledElement, viewport); } }, - // This has a weird hard dependency on the tools that are available as toolbar - // buttons. You can see this in `ohif-core/src/redux/reducers/tools.js` - // the `toolName` needs to equal the button's `command` property. - // NOTE: It would be nice if `hotkeys` could set this, instead of creating a command per tool - setCornerstoneToolActive: ({ toolName }) => { - console.warn(toolName); + // TODO: this is receiving `evt` from `ToolbarRow`. We could use it to have + // better mouseButtonMask sets. + setToolActive: ({ toolName }) => { + if (!toolName) { + console.warn('No toolname provided to setToolActive command'); + } cornerstoneTools.setToolActive(toolName, { mouseButtonMask: 1 }); - // store.dispatch(setToolActive(toolName)); }, updateViewportDisplaySet: ({ direction }) => { // TODO @@ -173,13 +164,8 @@ const definitions = { options: { direction: -1 } }, // TOOLS - setZoomTool: { - commandFn: actions.setCornerstoneToolActive, - storeContexts: [], - options: { toolName: 'Zoom' } - }, setToolActive: { - commandFn: actions.setCornerstoneToolActive, + commandFn: actions.setToolActive, storeContexts: [], options: {} }