From 73c63074c3af79c3af83cac0a13c51215895c445 Mon Sep 17 00:00:00 2001 From: Lukasz Ostafin Date: Wed, 18 Sep 2024 14:35:43 +0200 Subject: [PATCH] afetr QA --- .../public/js/CKEditor/custom-tags/helpers/panel-helper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js index 9c332499..a51e6ca4 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/helpers/panel-helper.js @@ -1,5 +1,6 @@ const setPanelContentMaxHeight = (balloonView) => { const HEADER_HEIGHT = 90; + const MIN_HEIGHT_VALUE = 220; const { innerHeight: windowHeight } = window; const { top: panelTopPosition, element: panelNode } = balloonView; const panelHeader = panelNode.querySelector('.ibexa-custom-tag-panel-header'); @@ -16,8 +17,9 @@ const setPanelContentMaxHeight = (balloonView) => { const maxHeightValue = isPanelOverTopWindowEdge ? panelContent.offsetHeight - Math.abs(panelTopPosition) : windowHeight - panelTopPosition - panelHeaderHeight - panelFooterHeight; + const panelMaxHeight = maxHeightValue < MIN_HEIGHT_VALUE ? MIN_HEIGHT_VALUE : maxHeightValue; - panelContent.style.maxHeight = `${maxHeightValue}px`; + panelContent.style.maxHeight = `${panelMaxHeight}px`; }; export { setPanelContentMaxHeight };