From cc5df5b748c30c966dfb9d8c0763b81a828506f5 Mon Sep 17 00:00:00 2001 From: Vitor Mateus De Almeida Date: Mon, 6 Jul 2020 09:58:50 -0300 Subject: [PATCH] Fix visual bug --- .../ui/components/layout/layout-manager.jsx | 4 +-- .../webcam-draggable-overlay/component.jsx | 26 ++++++++++------ .../ui/components/presentation/component.jsx | 31 +++---------------- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx b/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx index 5157c1df3b..0ef6dd6f3a 100644 --- a/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx +++ b/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx @@ -71,7 +71,7 @@ class LayoutManager extends Component { window.addEventListener('resize', _.throttle(() => this.setLayoutSizes(), 200)); window.addEventListener('panelChanged', () => { - setTimeout(() => this.setLayoutSizes(true), 200); + this.setLayoutSizes(true); }); window.addEventListener('autoArrangeChanged', () => { @@ -91,7 +91,7 @@ class LayoutManager extends Component { }); window.addEventListener('webcamPlacementChange', () => { - setTimeout(() => this.setLayoutSizes(false, false, true), 200); + this.setLayoutSizes(false, false, true); }); } diff --git a/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx b/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx index 97a64b4e8b..ca23bace85 100644 --- a/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx @@ -43,6 +43,7 @@ class WebcamDraggable extends PureComponent { height: webcamsPlacement === 'left' || webcamsPlacement === 'right' ? mediaBounds.height : mediaBounds.height * WEBCAMSAREA_MIN_PERCENT, }, resizing: false, + hideWebcams: false, }; this.handleWebcamDragStart = this.handleWebcamDragStart.bind(this); @@ -176,6 +177,8 @@ class WebcamDraggable extends PureComponent { }); } + setHideWebcams(hideWebcams) { this.setState({ hideWebcams }); } + getWebcamsListBounds() { const { webcamDraggableState } = this.props; const { videoListRef } = webcamDraggableState; @@ -194,13 +197,6 @@ class WebcamDraggable extends PureComponent { return false; } - handleLayoutSizesSets() { - const { layoutContextState } = this.props; - const { webcamsAreaSize } = layoutContextState; - - this.setWebcamsAreaResizable(webcamsAreaSize.width, webcamsAreaSize.height); - } - calculatePosition() { const { layoutContextState } = this.props; const { mediaBounds } = layoutContextState; @@ -215,6 +211,14 @@ class WebcamDraggable extends PureComponent { }; } + handleLayoutSizesSets() { + const { layoutContextState } = this.props; + const { webcamsAreaSize } = layoutContextState; + + this.setWebcamsAreaResizable(webcamsAreaSize.width, webcamsAreaSize.height); + this.setHideWebcams(false); + } + handleWebcamDragStart() { const { webcamDraggableDispatch } = this.props; const { x, y } = this.calculatePosition(); @@ -234,6 +238,8 @@ class WebcamDraggable extends PureComponent { const { webcamDraggableDispatch, layoutContextDispatch } = this.props; const targetClassname = JSON.stringify(e.target.className); + this.setHideWebcams(true); + layoutContextDispatch( { type: 'setAutoArrangeLayout', @@ -278,7 +284,7 @@ class WebcamDraggable extends PureComponent { audioModalIsOpen, } = this.props; - const { resizing, webcamsAreaResizable } = this.state; + const { resizing, webcamsAreaResizable, hideWebcams } = this.state; const { mediaBounds, @@ -476,10 +482,12 @@ class WebcamDraggable extends PureComponent { className={ !swapLayout ? overlayClassName - : contentClassName} + : contentClassName + } style={{ marginLeft: 0, marginRight: 0, + display: hideWebcams ? 'none' : undefined, }} > { diff --git a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx index 859b14d873..5e9e0f84ae 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx @@ -44,7 +44,6 @@ class PresentationArea extends PureComponent { zoom: 100, fitToWidth: false, isFullscreen: false, - hidePresentation: false, }; this.currentPresentationToastId = null; @@ -92,11 +91,7 @@ class PresentationArea extends PureComponent { this.getInitialPresentationSizes(); this.refPresentationContainer.addEventListener('fullscreenchange', this.onFullscreenChange); window.addEventListener('resize', this.onResize, false); - window.addEventListener('webcamPlacementChange', () => this.visibilityChange(true), false); - window.addEventListener('layoutSizesSets', () => { - this.onResize(); - this.visibilityChange(false); - }, false); + window.addEventListener('layoutSizesSets', this.onResize, false); window.addEventListener('webcamAreaResize', this.handleResize, false); const { slidePosition, layoutContextDispatch } = this.props; @@ -276,10 +271,6 @@ class PresentationArea extends PureComponent { this.setState({ fitToWidth }); } - visibilityChange(hidePresentation) { - this.setState({ hidePresentation }); - } - handleResize() { const presentationSizes = this.getPresentationSizesAvailable(); if (Object.keys(presentationSizes).length > 0) { @@ -705,10 +696,9 @@ class PresentationArea extends PureComponent { const { showSlide, - fitToWidth, - presentationAreaWidth, + // fitToWidth, + // presentationAreaWidth, localPosition, - hidePresentation, } = this.state; let viewBoxDimensions; @@ -738,26 +728,13 @@ class PresentationArea extends PureComponent { let toolbarWidth = 0; if (this.refWhiteboardArea) { - if (svgWidth === presentationAreaWidth - || presentationAreaWidth <= 400 - || fitToWidth === true) { - toolbarWidth = '100%'; - } else if (svgWidth <= 400 - && presentationAreaWidth > 400) { - toolbarWidth = '400px'; - } else { - toolbarWidth = svgWidth; - } + toolbarWidth = svgWidth; } return (
{ this.refPresentationContainer = ref; }} className={styles.presentationContainer} - - style={{ - visibility: hidePresentation ? 'hidden' : 'visible', - }} >
{ this.refPresentationArea = ref; }}