12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- KindEditor.plugin('autoheight', function(K) {
- var self = this;
- if (!self.autoHeightMode) {
- return;
- }
- var minHeight;
- function hideScroll() {
- var edit = self.edit;
- var body = edit.doc.body;
- edit.iframe[0].scroll = 'no';
- body.style.overflowY = 'hidden';
- }
- function 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) + 76, minHeight));
- }
- function init() {
- minHeight = K.removeUnit(self.height);
- self.edit.afterChange(resetHeight);
- hideScroll();
- resetHeight();
- }
- if (self.isCreated) {
- init();
- } else {
- self.afterCreate(init);
- }
- });
|