From 8848b3975e2bf6a111b26b827fae8b571de9a07f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 11 Sep 2015 10:52:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E7=94=9F=E6=88=90=E7=9A=84ki?= =?UTF-8?q?ndeditor=E5=A4=AA=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kindeditor/plugins/autoheight/autoheight.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/assets/kindeditor/plugins/autoheight/autoheight.js b/public/assets/kindeditor/plugins/autoheight/autoheight.js index 546578bfa..3c25fe49e 100644 --- a/public/assets/kindeditor/plugins/autoheight/autoheight.js +++ b/public/assets/kindeditor/plugins/autoheight/autoheight.js @@ -27,7 +27,9 @@ KindEditor.plugin('autoheight', function(K) { var edit = self.edit; var body = edit.doc.body; edit.iframe.height(minHeight); - self.resize(null, Math.max((K.IE ? body.scrollHeight : body.offsetHeight) + 76, minHeight)); + self.resize(null, Math.max( + (K.IE ? body.scrollHeight : body.offsetHeight) + + 76, minHeight)); } function init() { @@ -35,7 +37,12 @@ KindEditor.plugin('autoheight', function(K) { self.edit.afterChange(resetHeight); hideScroll(); - resetHeight(); + var edit = self.edit; + var body = edit.doc.body; + edit.iframe.height(minHeight); + self.resize(null, Math.max( + ((K.IE ? body.scrollHeight : body.offsetHeight) > 500 ? 500 : (K.IE ? body.scrollHeight : body.offsetHeight)) //限制初始化太高的情况 + + 76, minHeight)); } if (self.isCreated) {