@@ -115,6 +115,7 @@ export default class CallView extends React.Component<IProps, IState> {
115115 private controlsHideTimer : number = null ;
116116 private dialpadButton = createRef < HTMLDivElement > ( ) ;
117117 private contextMenuButton = createRef < HTMLDivElement > ( ) ;
118+ private contextMenu = createRef < HTMLDivElement > ( ) ;
118119
119120 constructor ( props : IProps ) {
120121 super ( props ) ;
@@ -545,12 +546,42 @@ export default class CallView extends React.Component<IProps, IState> {
545546 ) ;
546547 }
547548
549+ let dialPad ;
550+ if ( this . state . showDialpad ) {
551+ dialPad = < DialpadContextMenu
552+ { ...alwaysAboveRightOf (
553+ this . dialpadButton . current . getBoundingClientRect ( ) ,
554+ ChevronFace . None ,
555+ CONTEXT_MENU_VPADDING ,
556+ ) }
557+ mountAsChild = { true }
558+ onFinished = { this . closeDialpad }
559+ call = { this . props . call }
560+ /> ;
561+ }
562+
563+ let contextMenu ;
564+ if ( this . state . showMoreMenu ) {
565+ contextMenu = < CallContextMenu
566+ { ...alwaysAboveLeftOf (
567+ this . contextMenuButton . current . getBoundingClientRect ( ) ,
568+ ChevronFace . None ,
569+ CONTEXT_MENU_VPADDING ,
570+ ) }
571+ mountAsChild = { true }
572+ onFinished = { this . closeContextMenu }
573+ call = { this . props . call }
574+ /> ;
575+ }
576+
548577 return (
549578 < div
550579 className = { callControlsClasses }
551580 onMouseEnter = { this . onCallControlsMouseEnter }
552581 onMouseLeave = { this . onCallControlsMouseLeave }
553582 >
583+ { dialPad }
584+ { contextMenu }
554585 { dialpadButton }
555586 < AccessibleButton
556587 className = { micClasses }
@@ -858,37 +889,9 @@ export default class CallView extends React.Component<IProps, IState> {
858889 myClassName = 'mx_CallView_pip' ;
859890 }
860891
861- let dialPad ;
862- if ( this . state . showDialpad ) {
863- dialPad = < DialpadContextMenu
864- { ...alwaysAboveRightOf (
865- this . dialpadButton . current . getBoundingClientRect ( ) ,
866- ChevronFace . None ,
867- CONTEXT_MENU_VPADDING ,
868- ) }
869- onFinished = { this . closeDialpad }
870- call = { this . props . call }
871- /> ;
872- }
873-
874- let contextMenu ;
875- if ( this . state . showMoreMenu ) {
876- contextMenu = < CallContextMenu
877- { ...alwaysAboveLeftOf (
878- this . contextMenuButton . current . getBoundingClientRect ( ) ,
879- ChevronFace . None ,
880- CONTEXT_MENU_VPADDING ,
881- ) }
882- onFinished = { this . closeContextMenu }
883- call = { this . props . call }
884- /> ;
885- }
886-
887892 return < div className = { "mx_CallView " + myClassName } >
888893 { header }
889894 { contentView }
890- { dialPad }
891- { contextMenu }
892895 </ div > ;
893896 }
894897}
0 commit comments