@@ -2,7 +2,6 @@ import { Component } from 'react';
22import PropTypes from 'prop-types' ;
33import cn from 'classnames' ;
44import Paper from '@material-ui/core/Paper' ;
5- import { MosaicWindowContext } from 'react-mosaic-component/lib/contextTypes' ;
65import ns from '../config/css-ns' ;
76import WindowTopBar from '../containers/WindowTopBar' ;
87import PrimaryWindow from '../containers/PrimaryWindow' ;
@@ -35,24 +34,19 @@ export class Window extends Component {
3534 */
3635 wrappedTopBar ( ) {
3736 const {
38- windowId , workspaceType , windowDraggable,
37+ dragHandle , windowId , windowDraggable,
3938 } = this . props ;
4039
4140 const topBar = (
42- < div >
41+ < div ref = { dragHandle } >
4342 < WindowTopBar
4443 windowId = { windowId }
4544 windowDraggable = { windowDraggable }
45+ dragHandle = { dragHandle }
4646 />
4747 < IIIFAuthentication windowId = { windowId } />
4848 </ div >
4949 ) ;
50- if ( workspaceType === 'mosaic' && windowDraggable ) {
51- const { mosaicWindowActions } = this . context ;
52- return mosaicWindowActions . connectDragSource (
53- topBar ,
54- ) ;
55- }
5650 return topBar ;
5751 }
5852
@@ -119,10 +113,12 @@ export class Window extends Component {
119113 }
120114}
121115
122- Window . contextType = MosaicWindowContext ;
123-
124116Window . propTypes = {
125117 classes : PropTypes . objectOf ( PropTypes . string ) ,
118+ dragHandle : PropTypes . oneOfType ( [
119+ PropTypes . func ,
120+ PropTypes . shape ( { current : PropTypes . instanceOf ( Element ) } ) ,
121+ ] ) ,
126122 focusWindow : PropTypes . func ,
127123 isFetching : PropTypes . bool ,
128124 label : PropTypes . string ,
@@ -133,11 +129,11 @@ Window.propTypes = {
133129 view : PropTypes . string ,
134130 windowDraggable : PropTypes . bool ,
135131 windowId : PropTypes . string . isRequired ,
136- workspaceType : PropTypes . string ,
137132} ;
138133
139134Window . defaultProps = {
140135 classes : { } ,
136+ dragHandle : null ,
141137 focusWindow : ( ) => { } ,
142138 isFetching : false ,
143139 label : null ,
@@ -146,5 +142,4 @@ Window.defaultProps = {
146142 sideBarOpen : false ,
147143 view : undefined ,
148144 windowDraggable : null ,
149- workspaceType : null ,
150145} ;
0 commit comments