Skip to content

Commit 9e9924f

Browse files
authored
IBX-9097: [PB] Error with Richtext validator in nested_attribute (#191)
1 parent e9bbcaf commit 9e9924f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,15 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0;
281281
'.ibexa-field-edit__distraction-free-mode-control-container .ibexa-field-edit__distraction-free-mode-btns',
282282
);
283283

284-
if (distractionFreeModeControlNodeBtn === null) {
285-
return;
286-
}
287-
288284
const dataSourceNode = fieldEditNode.querySelector('.ibexa-data-source');
289-
const { offsetWidth: distractionFreeModeControlNodeBtnWidth } = distractionFreeModeControlNodeBtn;
290285
const { offsetWidth: dataSourceNodeWidth } = dataSourceNode;
291-
const toolbarNodeMaxWidth = dataSourceNodeWidth - distractionFreeModeControlNodeBtnWidth;
286+
let toolbarNodeMaxWidth = dataSourceNodeWidth;
287+
288+
if (distractionFreeModeControlNodeBtn !== null) {
289+
const { offsetWidth: distractionFreeModeControlNodeBtnWidth } = distractionFreeModeControlNodeBtn;
290+
291+
toolbarNodeMaxWidth = dataSourceNodeWidth - distractionFreeModeControlNodeBtnWidth;
292+
}
292293

293294
toolbarNode.style.maxWidth = `${toolbarNodeMaxWidth}px`;
294295
};

0 commit comments

Comments
 (0)