@@ -27,14 +27,14 @@ export class IFramePanelContent extends React.Component<IIFramePanelContentProps
27
27
if ( this . _iframe ) {
28
28
const mainDiv = this . findParent ( this . _iframe , "ms-Panel-main" ) ;
29
29
const commandsDiv = mainDiv . querySelector ( ".ms-Panel-commands" ) as HTMLDivElement ;
30
- const headerDiv = mainDiv . querySelector ( "ms-Panel-header" ) as HTMLDivElement ;
31
- const footerDiv = mainDiv . querySelector ( "ms-Panel-footer" ) as HTMLDivElement ;
30
+ const headerDiv = mainDiv . querySelector ( ". ms-Panel-header" ) as HTMLDivElement ;
31
+ const footerDiv = mainDiv . querySelector ( ". ms-Panel-footer" ) as HTMLDivElement ;
32
32
33
33
let height = this . getTrueHeight ( mainDiv ) ;
34
34
height = height - this . getTrueHeight ( commandsDiv ) ;
35
35
height = height - this . getTrueHeight ( headerDiv ) ;
36
36
height = height - this . getTrueHeight ( footerDiv ) ;
37
- height = height - 20 ; // padding on content div
37
+ height = height - 25 ; // padding on content div
38
38
39
39
this . _iframe . height = height . toString ( ) + 'px' ;
40
40
}
@@ -59,9 +59,9 @@ export class IFramePanelContent extends React.Component<IIFramePanelContentProps
59
59
*/
60
60
private getTrueHeight ( elm : HTMLElement ) : number {
61
61
if ( elm ) {
62
- const style = elm . style || window . getComputedStyle ( elm ) ;
62
+ const style = window . getComputedStyle && window . getComputedStyle ( elm ) || elm . style ;
63
63
let marginTop = parseInt ( ( style . marginTop as string ) . replace ( "px" , "" ) ) ;
64
- let marginBottom = parseInt ( ( style . marginTop as string ) . replace ( "px" , "" ) ) ;
64
+ let marginBottom = parseInt ( ( style . marginBottom as string ) . replace ( "px" , "" ) ) ;
65
65
if ( isNaN ( marginTop ) ) {
66
66
marginTop = 0 ;
67
67
}
0 commit comments