Skip to content

Commit

Permalink
Merge branch '4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Oct 24, 2024
2 parents 1418e73 + 9e9924f commit 533ac84
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,15 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0;
'.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;
const toolbarNodeMaxWidth = dataSourceNodeWidth - distractionFreeModeControlNodeBtnWidth;
let toolbarNodeMaxWidth = dataSourceNodeWidth;

if (distractionFreeModeControlNodeBtn !== null) {
const { offsetWidth: distractionFreeModeControlNodeBtnWidth } = distractionFreeModeControlNodeBtn;

toolbarNodeMaxWidth = dataSourceNodeWidth - distractionFreeModeControlNodeBtnWidth;
}

toolbarNode.style.maxWidth = `${toolbarNodeMaxWidth}px`;
};
Expand Down

0 comments on commit 533ac84

Please sign in to comment.