From 44c99fb0ef1817b5b69fdb6c4eb37ef93daf379c Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Wed, 17 Nov 2021 15:26:58 +0100 Subject: [PATCH] Fix zoom from cowebsite changes --- front/src/WebRtc/CoWebsiteManager.ts | 12 ++++++++++++ front/style/cowebsite.scss | 1 + 2 files changed, 13 insertions(+) diff --git a/front/src/WebRtc/CoWebsiteManager.ts b/front/src/WebRtc/CoWebsiteManager.ts index 23dd7e2a..211da998 100644 --- a/front/src/WebRtc/CoWebsiteManager.ts +++ b/front/src/WebRtc/CoWebsiteManager.ts @@ -361,6 +361,8 @@ class CoWebsiteManager { oldSlot.container.style.display = "none"; } + this.displayCowebsiteContainer(); + newSlot.container.style.display = "block"; coWebsite.iframe.classList.remove("pixel"); @@ -368,6 +370,14 @@ class CoWebsiteManager { this.resizeAllIframes(); } + private displayCowebsiteContainer() { + if (this.coWebsites.find((cowebsite) => cowebsite.position > 0)) { + this.cowebsiteContainerDom.style.display = "block"; + } else { + this.cowebsiteContainerDom.style.display = "none"; + } + } + private moveLeftPreviousCoWebsite(coWebsite: CoWebsite, newPosition: number) { const nextCoWebsite = this.getCoWebsiteByPosition(coWebsite.position + 1); @@ -422,6 +432,8 @@ class CoWebsiteManager { this.moveLeftPreviousCoWebsite(previousCoWebsite, coWebsite.position); } + this.displayCowebsiteContainer(); + coWebsite.icon.remove(); coWebsite.iframe.remove(); } diff --git a/front/style/cowebsite.scss b/front/style/cowebsite.scss index 8feb517d..69085cc1 100644 --- a/front/style/cowebsite.scss +++ b/front/style/cowebsite.scss @@ -65,6 +65,7 @@ &-container { position: absolute; + display: none; height: 100%; width: 100%;