This commit is contained in:
sw 2015-09-11 11:36:59 +08:00
commit 6004fe1b4d
1 changed files with 9 additions and 2 deletions

View File

@ -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) {