@@ -45,6 +45,9 @@ let EntityDetail = React.createClass( {
4545 entityobj : this . props . entityobj ,
4646 height : null ,
4747 isMounted : false ,
48+ width : 0 ,
49+ entityModalHeight :0
50+
4851 } ;
4952 } ,
5053 componentWillMount : function ( ) {
@@ -221,18 +224,21 @@ let EntityDetail = React.createClass( {
221224 } ) ;
222225 } ) ;
223226 this . props . watcher ( ) ;
227+ const varheight = document . getElementById ( 'container' ) . clientHeight ;
228+ this . setState ( { entityModalHeight :varheight } )
229+ this . updateWindowDimensions ( ) ;
230+ window . addEventListener ( 'resize' , this . updateWindowDimensions ) ;
224231 } ,
225232
233+ updateWindowDimensions : function ( ) {
234+ this . setState ( { width : window . innerWidth , height : window . innerHeight } ) ;
235+ } ,
226236
227237 componentWillUnmount : function ( ) {
228238 this . setState ( { isMounted : false } ) ;
229239 //removes escHandler bind
230240 $ ( document ) . off ( 'keydown' ) ;
231- //This makes the size that was last used hold for future entities
232- /*let height = $('#dragme').height();
233- let width = $('#dragme').width();
234- entityPopUpHeight = height;
235- entityPopUpWidth = width;*/
241+ window . removeEventListener ( 'resize' , this . updateWindowDimensions ) ;
236242 } ,
237243 componentWillReceiveProps : function ( nextProps ) {
238244 this . onLoad ( ) ;
@@ -474,12 +480,17 @@ let EntityDetail = React.createClass( {
474480 }
475481 }
476482 } ,
483+
484+
485+
486+
477487 render : function ( ) {
478488 //This makes the size that was last used hold for future entities
479489 /*if (entityPopUpHeight && entityPopUpWidth) {
480490 entityHeight = entityPopUpHeight;
481491 entityWidth = entityPopUpWidth;
482492 }*/
493+ let heightboundary = 200 - this . state . defaultEntityOffset . top
483494 let defaultOffsetY ;
484495 let defaultOffsetX ;
485496 let tabsArr = [ ] ;
@@ -530,7 +541,7 @@ let EntityDetail = React.createClass( {
530541 ) ;
531542 } else {
532543 return (
533- < Draggable handle = "#handle" onMouseDown = { this . moveDivInit } >
544+ < Draggable handle = "#handle" bounds = { { top : heightboundary } } onMouseDown = { this . moveDivInit } >
534545 < div id = "dragme" className = { DragmeClass } style = { { width :this . state . entityWidth , left :defaultOffsetX , maxHeight :'90vh' } } >
535546 < div id = 'popup-flex-container' style = { { height : '100%' , display :'flex' , flexFlow :'row' } } >
536547 < div id = "entity_detail_container" style = { { flexFlow : 'column' , display : 'flex' , width :'100%' } } >
0 commit comments