Skip to content

Commit

Permalink
FIX HTMLEditorField::setRows method
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Jan 10, 2024
1 parent 0755502 commit 7185c77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion client/src/legacy/HtmlEditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,24 @@ ss.editorWrappers.tinyMCE = (function() {

config.skin = config.skin || 'silverstripe';

var initSetup = (editor) => {
const setHeight = (e, height) => {
if (e.target && e.target.iframeElement) {
e.target.iframeElement.height = height !== '' ? 'auto' : height;
e.target.iframeElement.parentNode.parentNode.style.height = height;
}
}
editor.on('init', (e) => {
let height = document.querySelector(config.selector).style.height;
setHeight(e, height);
});
editor.on('ResizeEditor', (e) => {
setHeight(e, '');
});
}

// Bind the floatpanel hide and reposition listener to the closest scrollable panel
tinymce.init(config).then((editors) => {
tinymce.init({...config, setup: initSetup}).then((editors) => {
if(editors.length > 0 && editors[0].container) {
const scrollPanel = $(editors[0].container).closest('.panel--scrollable');
scrollPanel.on('scroll', (e) => hideOnScroll(e));
Expand Down

0 comments on commit 7185c77

Please sign in to comment.