From a777610c2dd783f8f0d841ffea7b5e386e9dee70 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 7 Jan 2021 11:45:57 +0100 Subject: [PATCH] Fix htmlarea resize --- api/js/etemplate/et2_widget_htmlarea.js | 4 ++-- api/js/etemplate/et2_widget_htmlarea.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/et2_widget_htmlarea.js b/api/js/etemplate/et2_widget_htmlarea.js index 7b271e5b66..780ba905b6 100644 --- a/api/js/etemplate/et2_widget_htmlarea.js +++ b/api/js/etemplate/et2_widget_htmlarea.js @@ -338,6 +338,7 @@ var et2_htmlarea = /** @class */ (function (_super) { * @param {type} _height excess height which comes from window resize */ et2_htmlarea.prototype.resize = function (_height) { + var _a, _b; if (_height && this.options.resize_ratio !== '0') { // apply the ratio _height = (this.options.resize_ratio != '') ? _height * this.options.resize_ratio : _height; @@ -354,8 +355,7 @@ var et2_htmlarea = /** @class */ (function (_super) { h = this.editor.settings.min_height + _height; } jQuery(this.editor.editorContainer).height(h); - jQuery(this.editor.iframeElement).height(h - (this.editor.editorContainer.getElementsByClassName('tox-toolbar')[0].clientHeight + - this.editor.editorContainer.getElementsByClassName('tox-statusbar')[0].clientHeight)); + jQuery(this.editor.iframeElement).height(h - (((_a = this.editor.editorContainer.getElementsByClassName('tox-editor-header')[0]) === null || _a === void 0 ? void 0 : _a.clientHeight) + ((_b = this.editor.editorContainer.getElementsByClassName('tox-statusbar')[0]) === null || _b === void 0 ? void 0 : _b.clientHeight))); } else // No TinyMCE { diff --git a/api/js/etemplate/et2_widget_htmlarea.ts b/api/js/etemplate/et2_widget_htmlarea.ts index ccede69fa1..352cf911c6 100644 --- a/api/js/etemplate/et2_widget_htmlarea.ts +++ b/api/js/etemplate/et2_widget_htmlarea.ts @@ -531,8 +531,8 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable h = this.editor.settings.min_height + _height; } jQuery(this.editor.editorContainer).height(h); - jQuery(this.editor.iframeElement).height(h - (this.editor.editorContainer.getElementsByClassName('tox-toolbar')[0].clientHeight + - this.editor.editorContainer.getElementsByClassName('tox-statusbar')[0].clientHeight)); + jQuery(this.editor.iframeElement).height(h - (this.editor.editorContainer.getElementsByClassName('tox-editor-header')[0]?.clientHeight + + this.editor.editorContainer.getElementsByClassName('tox-statusbar')[0]?.clientHeight)); } else // No TinyMCE {