Skip to content

Commit

Permalink
Merge pull request #1660 from creative-commoners/pulls/2.1/fix-elemen…
Browse files Browse the repository at this point in the history
…tal-htmleditor

FIX HTMLEditorField::setRows with Elemental
  • Loading branch information
GuySartorelli authored Jan 25, 2024
2 parents bcd15c1 + 799add9 commit 20dbe25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion client/src/legacy/HtmlEditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ ss.editorWrappers.tinyMCE = (function() {
},

setHeight: function (event, height) {
if (typeof height === 'undefined') {
return;
}
if (event.target && event.target.iframeElement) {
event.target.iframeElement.height = height !== '' ? 'auto' : height;
const parentDiv = event.target.iframeElement.closest('.tox-sidebar-wrap');
Expand All @@ -83,6 +86,7 @@ ss.editorWrappers.tinyMCE = (function() {
getConfig: function() {
var selector = "#" + editorID,
config = jQuery(selector).data('config'),
height = config.row_height ? config.row_height : 'undefined',
self = this;

// Add instance specific data to config
Expand All @@ -94,7 +98,6 @@ ss.editorWrappers.tinyMCE = (function() {
self.save();
});
ed.on('init', (event) => {
let height = document.querySelector(config.selector).style.height;
self.setHeight(event, height);
});
ed.on('ResizeEditor', (event) => {
Expand Down

0 comments on commit 20dbe25

Please sign in to comment.