Make sure plugin is set for cornerstone viewports before a layout change is triggered
This commit is contained in:
1 parent
6050721d33
commit
8b636b53be
2 files changed
+3
-9
No files matched your search
@@ -3,11 +3,7 @@ import OHIF from 'ohif-core';
|
||||
import { connect } from 'react-redux';
|
||||
import throttle from 'lodash.throttle';
|
||||
|
||||
const {
|
||||
setViewportActive,
|
||||
setViewportSpecificData,
|
||||
clearViewportSpecificData
|
||||
} = OHIF.redux.actions;
|
||||
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
let dataFromStore;
|
||||
@@ -58,6 +54,8 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
||||
const enabledElement = event.detail.element;
|
||||
dispatch(
|
||||
setViewportSpecificData(viewportIndex, {
|
||||
// TODO: Hack to make sure our plugin info is available from the outset
|
||||
plugin: 'cornerstone',
|
||||
dom: enabledElement
|
||||
})
|
||||
);
|
||||
|
||||
@@ -159,14 +159,10 @@ function _getVisibleToolbarButtons() {
|
||||
definitions.forEach(definition => {
|
||||
const context = definition.context || defaultContext;
|
||||
|
||||
console.log(context);
|
||||
if (this.props.activeContexts.includes(context)) {
|
||||
console.log('includes: ', definition.commandName);
|
||||
toolbarButtonDefinitions.push(definition);
|
||||
}
|
||||
});
|
||||
|
||||
console.log(extension);
|
||||
});
|
||||
|
||||
return toolbarButtonDefinitions;
|
||||
|
||||
Reference in new issue
Block a user