From 15f18e20b5e4e4cfff7c930edb213d3da98706e3 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 30 Apr 2015 08:07:23 +0000 Subject: [PATCH] Make sure the content of CKeidtor is ready before resize and check for none participant to resize --- etemplate/js/et2_widget_htmlarea.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/etemplate/js/et2_widget_htmlarea.js b/etemplate/js/et2_widget_htmlarea.js index 3832d63c29..69de91011a 100644 --- a/etemplate/js/et2_widget_htmlarea.js +++ b/etemplate/js/et2_widget_htmlarea.js @@ -263,7 +263,7 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable], */ resize: function (_height) { - if (_height) + if (_height && this.options.resize_ratio !== '0') { // apply the ratio _height = (this.options.resize_ratio != '')? _height * this.options.resize_ratio: _height; @@ -272,14 +272,20 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable], if (this.ckeditor) // CKEDITOR HTML { var h = 0; - if (typeof this.ckeditor.container.$ != 'undefined' && this.ckeditor.container.$.clientHeight > 0) - { h = (this.ckeditor.container.$.clientHeight + _height) > 0 ? + if (typeof this.ckeditor.container !='undefined' && this.ckeditor.container.$.clientHeight > 0) + { + h = (this.ckeditor.container.$.clientHeight + _height) > 0 ? this.ckeditor.container.$.clientHeight + _height: this.ckeditor.config.height; } - else + else if (this.ckeditor.ui.space('contents')) { h = parseInt(this.ckeditor.ui.space('contents').getStyle('height')) + _height; } + else // fallback height size + { + h = this.ckeditor.config.height + _height; + } + this.ckeditor.resize(0,h); } else // No CKEDITOR