From 0912d86909a1797edc045fe61edbb202695d8021 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Mon, 3 Jun 2024 23:41:08 +0200 Subject: [PATCH] IBX-8352: Handled disabled distraction-free mode --- .../Resources/public/js/CKEditor/core/base-ckeditor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 77c7937f..517d6276 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -262,6 +262,11 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0; const distractionFreeModeControlNodeBtn = fieldEditNode.querySelector( '.ibexa-field-edit__distraction-free-mode-control-container .ibexa-field-edit__distraction-free-mode-btns', ); + + if (distractionFreeModeControlNodeBtn === null) { + return; + } + const dataSourceNode = fieldEditNode.querySelector('.ibexa-data-source'); const { offsetWidth: distractionFreeModeControlNodeBtnWidth } = distractionFreeModeControlNodeBtn; const { offsetWidth: dataSourceNodeWidth } = dataSourceNode;