From bca5cc9fbe54ad26956a77676544ee4088bd425d Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Thu, 17 Nov 2022 23:37:17 +0000 Subject: [PATCH] fix toolbar not responding to wb width --- .../imports/ui/components/whiteboard/component.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx b/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx index 6fed5c12d6..15557d0171 100644 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx @@ -45,6 +45,8 @@ const mapLanguage = (language) => { const SMALL_HEIGHT = 435; const SMALLEST_HEIGHT = 363; +const SMALL_WIDTH = 800; +const SMALLEST_WIDTH = 645; const TOOLBAR_SMALL = 28; const TOOLBAR_LARGE = 38; const TOOLBAR_OFFSET = 0; @@ -406,7 +408,8 @@ export default function Whiteboard(props) { const tdTools = document.getElementById("TD-Tools"); if (tdToolsDots && tdDelete && tdPrimaryTools) { - const size = props.height < SMALL_HEIGHT ? TOOLBAR_SMALL : TOOLBAR_LARGE; + const size = ((props.height < SMALL_HEIGHT) || (props.width < SMALL_WIDTH)) + ? TOOLBAR_SMALL : TOOLBAR_LARGE; tdToolsDots.style.height = `${size}px`; tdToolsDots.style.width = `${size}px`; const delButton = tdDelete.getElementsByTagName('button')[0]; @@ -418,7 +421,7 @@ export default function Whiteboard(props) { item.style.width = `${size}px`; } } - if (props.height < SMALLEST_HEIGHT && tdTools) { + if (((props.height < SMALLEST_HEIGHT) || (props.width < SMALLEST_WIDTH)) && tdTools) { tldrawAPI?.setSetting('dockPosition', 'bottom'); tdTools.parentElement.style.bottom = `${TOOLBAR_OFFSET}px`; }