From 5e05c59a5a9491e5f515f62477973cb129b81b97 Mon Sep 17 00:00:00 2001 From: Cal-Hagner <44558033+Cal-Hagner@users.noreply.github.com> Date: Sun, 13 Oct 2019 07:37:50 -0400 Subject: [PATCH] Hide controls when output is maximised --- src/web/waiters/RecipeWaiter.mjs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/web/waiters/RecipeWaiter.mjs b/src/web/waiters/RecipeWaiter.mjs index d198098b..8080d4eb 100755 --- a/src/web/waiters/RecipeWaiter.mjs +++ b/src/web/waiters/RecipeWaiter.mjs @@ -628,12 +628,21 @@ class RecipeWaiter { bakeIcon.style.display = "inline-block"; } - // Scale controls to fit pane width - const controls = document.getElementById("controls"); - const controlsContent = document.getElementById("controls-content"); - const scale = (controls.clientWidth - 1) / controlsContent.scrollWidth; + // Hide recipe controls when output is maximised + if (document.getElementById("i") === "fullscreen") { + document.getElementById("controls").style.display = "none"; + } + else { + // Show recipe controls if they are not already shown + document.getElementById("controls").style.display = "inherit"; - controlsContent.style.transform = `translate(-50%, -50%) scale(${scale})`; + // Scale controls to fit pane width + const controls = document.getElementById("controls"); + const controlsContent = document.getElementById("controls-content"); + const scale = (controls.clientWidth - 1) / controlsContent.scrollWidth; + + controlsContent.style.transform = `translate(-50%, -50%) scale(${scale})`; + } } }