Skip to content

Commit

Permalink
Issue #4031: fixed ckeditor overlapping in customer ui when resized v…
Browse files Browse the repository at this point in the history
…ery small
  • Loading branch information
chzauleck committed Feb 24, 2025
1 parent 0fa3dab commit 4a23768
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion var/httpd/htdocs/js/Core.UI.RichTextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,24 @@ Core.UI.RichTextEditor = (function (TargetNS) {
} );
}

// bind editor resize to container($domEditableElement) size change (ie. when changing window size)
// bind editor resize to container($domEditableElement) size change
const resizeObserver = new ResizeObserver(() => {
adjustEditorSize();
});
resizeObserver.observe($domEditableElement.first().get(0));

// set correct min-height for customer interface to prevent overlapping
if (CustomerInterface) {
const toolbarResizeObserver = new ResizeObserver(() => {
let toolbarHeight = $domEditableElement.find('.ck-editor__top').outerHeight();
let MinHeight = toolbarHeight + 100;

$domEditableElement.css('min-height', MinHeight + 'px');
});
toolbarResizeObserver.observe(editor.ui.view.toolbar.element);
}


//make sure editor size is adjusted whenever the toolbar changes size
//otherwise editor size can behave weirdly right after loading page
resizeObserver.observe(editor.ui.view.toolbar.element);
Expand Down

0 comments on commit 4a23768

Please sign in to comment.