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 { connect } from 'react-redux';
|
||||||
import throttle from 'lodash.throttle';
|
import throttle from 'lodash.throttle';
|
||||||
|
|
||||||
const {
|
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
|
||||||
setViewportActive,
|
|
||||||
setViewportSpecificData,
|
|
||||||
clearViewportSpecificData
|
|
||||||
} = OHIF.redux.actions;
|
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => {
|
const mapStateToProps = (state, ownProps) => {
|
||||||
let dataFromStore;
|
let dataFromStore;
|
||||||
@@ -58,6 +54,8 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
|||||||
const enabledElement = event.detail.element;
|
const enabledElement = event.detail.element;
|
||||||
dispatch(
|
dispatch(
|
||||||
setViewportSpecificData(viewportIndex, {
|
setViewportSpecificData(viewportIndex, {
|
||||||
|
// TODO: Hack to make sure our plugin info is available from the outset
|
||||||
|
plugin: 'cornerstone',
|
||||||
dom: enabledElement
|
dom: enabledElement
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -159,14 +159,10 @@ function _getVisibleToolbarButtons() {
|
|||||||
definitions.forEach(definition => {
|
definitions.forEach(definition => {
|
||||||
const context = definition.context || defaultContext;
|
const context = definition.context || defaultContext;
|
||||||
|
|
||||||
console.log(context);
|
|
||||||
if (this.props.activeContexts.includes(context)) {
|
if (this.props.activeContexts.includes(context)) {
|
||||||
console.log('includes: ', definition.commandName);
|
|
||||||
toolbarButtonDefinitions.push(definition);
|
toolbarButtonDefinitions.push(definition);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(extension);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return toolbarButtonDefinitions;
|
return toolbarButtonDefinitions;
|
||||||
|
|||||||
Reference in new issue
Block a user