From 1a6d628988eb0364bd846fd92563fb05351bbeb8 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 27 Apr 2015 09:11:25 +0000 Subject: [PATCH] Fix resizing htmlarea widget --- etemplate/js/et2_widget_htmlarea.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_htmlarea.js b/etemplate/js/et2_widget_htmlarea.js index 1a76e33660..e66322f4fa 100644 --- a/etemplate/js/et2_widget_htmlarea.js +++ b/etemplate/js/et2_widget_htmlarea.js @@ -267,7 +267,26 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable], { // apply the ratio _height = (this.options.resize_ratio != '')? _height * this.options.resize_ratio: _height; - if (_height != 0) this.htmlNode.height(this.htmlNode.height() + _height); + if (_height != 0) + { + if (this.ckeditor) // CKEDITOR HTML + { + var h = 0; + if (this.ckeditor.container.$.clientHeight > 0) + { h = (this.ckeditor.container.$.clientHeight + _height) > 0 ? + this.ckeditor.container.$.clientHeight + _height: this.ckeditor.config.height; + } + else + { + h = parseInt(this.ckeditor.ui.space('contents').getStyle('height')) + _height; + } + this.ckeditor.resize(0,h); + } + else // No CKEDITOR + { + this.htmlNode.height(this.htmlNode.height() + _height); + } + } } } });