@@ -186,6 +186,7 @@ var GEOComp = (function () {
186
186
"splitscreen:vertical" : false ,
187
187
debug : geoContext . previewMode ,
188
188
} ) ,
189
+ resizeOffset : withDefault ( NumberControl , 4 ) ,
189
190
external : jsonObjectExposingStateControl ( "external" ) ,
190
191
} ;
191
192
@@ -214,8 +215,8 @@ var GEOComp = (function () {
214
215
startDate : string ;
215
216
endDate : string ;
216
217
extent : any ;
217
- external : any
218
-
218
+ resizeOffset : number ;
219
+ external : any ;
219
220
test : any
220
221
} ) => {
221
222
//Default size of component
@@ -281,13 +282,14 @@ var GEOComp = (function () {
281
282
const pads = props . styles . padding . split ( ' ' ) ;
282
283
const marg = props . styles . margin . split ( ' ' ) ;
283
284
const offset = ( parseFloat ( pads [ pads . length == 4 ? 3 : 0 ] . replace ( "px" , "" ) ) * 2 ) + ( parseFloat ( marg [ marg . length == 4 ? 3 : 0 ] . replace ( "px" , "" ) ) * 2 )
284
- const parentOffset = 0
285
285
//TODO: Take care of margin and padding, but also that of parents
286
- var newHeight = dimensions . height + ( eventObj . windowSize . height - eventObj . bounds . bottom - ( offset + parentOffset ) )
287
- eventObj . element . style . height = `${ newHeight } px`
288
- setDimensions ( { width : dimensions . width , height : newHeight } )
289
- if ( featureEnabled ( "debug" ) )
290
- console . debug ( "Resized done" , newHeight )
286
+ var newHeight = dimensions . height + ( eventObj . windowSize . height - eventObj . bounds . bottom - ( offset + ( props . resizeOffset || 0 ) ) )
287
+ if ( newHeight != dimensions . height ) {
288
+ eventObj . element . style . height = `${ newHeight } px`
289
+ setDimensions ( { width : dimensions . width , height : newHeight } )
290
+ if ( featureEnabled ( "debug" ) )
291
+ console . debug ( "Resized done" , newHeight )
292
+ }
291
293
}
292
294
break
293
295
default :
@@ -369,6 +371,7 @@ var GEOComp = (function () {
369
371
</ Section >
370
372
< Section name = "Styles" >
371
373
{ children . autoHeight . getPropertyView ( ) }
374
+ { children . resizeOffset . propertyView ( { label : "Resize Offset" } ) }
372
375
{ children . styles . getPropertyView ( ) }
373
376
</ Section >
374
377
< Section name = "Behavior" open = "false" >
0 commit comments