Pull out cornerstone command registration

This commit is contained in:
dannyrb 2019-06-13 10:17:53 -04:00
parent 361be79174
commit 89b1ce4a4e
2 changed files with 1 additions and 23 deletions

View File

@ -54,7 +54,7 @@ store.dispatch({
}); });
store.dispatch({ store.dispatch({
type: 'ADD_ACTIVE_CONTEXT', type: 'ADD_ACTIVE_CONTEXT',
item: 'VIEWER::CORNERSTONE', item: 'ACTIVE_VIEWPORT::CORNERSTONE',
}); });
// ~~~~ END APP SETUP // ~~~~ END APP SETUP

View File

@ -1,4 +1,3 @@
import cornerstoneCommandDefinitions from './cornerstone.js';
import viewerCommandDefinitions from './viewer.js'; import viewerCommandDefinitions from './viewer.js';
const CONTEXTS = { const CONTEXTS = {
@ -12,7 +11,6 @@ const CONTEXTS = {
*/ */
function init(commandsManager) { function init(commandsManager) {
_registerViewerCommands(commandsManager); _registerViewerCommands(commandsManager);
_registerCornerstoneCommands(commandsManager);
} }
/** /**
@ -35,26 +33,6 @@ function _registerViewerCommands(commandsManager) {
}); });
} }
/**
* Register all Cornerstone commands
*
* @private
*/
function _registerCornerstoneCommands(commandsManager) {
const commandContext = CONTEXTS.cornerstone;
commandsManager.createContext(commandContext);
Object.keys(cornerstoneCommandDefinitions).forEach(commandName => {
const commandDefinition = cornerstoneCommandDefinitions[commandName];
commandsManager.registerCommand(
commandContext,
commandName,
commandDefinition
);
});
}
export default { export default {
init, init,
}; };