wip on react transition 10

This commit is contained in:
Erik Ziegler 2018-12-03 23:56:29 +01:00
parent 33fad2f317
commit aa170e9a89
4 changed files with 28 additions and 13 deletions

View File

@ -185,8 +185,7 @@ class CornerstoneViewport extends Component {
viewport={ viewport={
this.state.viewport this.state.viewport
} }
/> </div > <div className="viewportInstructions" > /> </div > {
Please drag a stack here to view images. </div> {
this.displayScrollbar && (<ImageScrollbar this.displayScrollbar && (<ImageScrollbar
onInputCallback={ onInputCallback={
this.imageSliderOnInputCallback this.imageSliderOnInputCallback

View File

@ -18,7 +18,7 @@
overflow: hidden overflow: hidden
.viewportInstructions .viewportInstructions
display: none display: block
font-size: 13px font-size: 13px
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
line-height: 18px line-height: 18px

View File

@ -76,6 +76,10 @@ class GridLayout extends Component {
const viewports = viewportData.map((data, index) => { const viewports = viewportData.map((data, index) => {
const className = `viewportContainer ${this.getClass(index)} ${this.getActiveClass(index)}`; const className = `viewportContainer ${this.getClass(index)} ${this.getActiveClass(index)}`;
// TODO[react]: Not sure why I needed to do this. Looks like
// empty viewports aren't provided with a viewportIndex normally?
data.viewportIndex = index;
const styles = { const styles = {
height: `${height}%`, height: `${height}%`,
@ -91,16 +95,28 @@ class GridLayout extends Component {
</div> </div>
); );
let contents;
if (!data.studyInstanceUid || !data.displaySetInstanceUid) {
contents = (
<div className="CornerstoneViewport">
<div className="viewportInstructions">
Please drag a stack here to view images.
</div>
</div>
);
} else if (data.plugin === 'cornerstone') {
contents = cornerstoneViewport(data);
} else {
contents = pluginViewport(data);
}
return ( return (
<div key={index} className={className} style={styles}> <div key={index} className={className} style={styles}>
{data.plugin === 'cornerstone' ? {contents}
cornerstoneViewport(data) : {/*{>seriesQuickSwitch (clone this viewport=viewport viewportIndex=@index)}*/}
pluginViewport(data) </div>
} );
{/*{>seriesQuickSwitch (clone this viewport=viewport viewportIndex=@index)}*/} });
</div>
)
})
const layoutClass = `layout-${rows}-${columns}`; const layoutClass = `layout-${rows}-${columns}`;

View File

@ -1,4 +1,4 @@
myOutputFolder/ myOutputFolder/
node_modules node_modules
client/sha.js StandaloneViewer/client/sha.js
client/version.js StandaloneViewer/client/version.js