From 3b9d1d6200344629abf12cc517def64a7a6afe70 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 9 Sep 2015 09:22:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=A1=86=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=8A=A8=E9=95=BF?= =?UTF-8?q?=E9=AB=98=E7=BC=A9=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/show.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 609294161..a9c0e9101 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -82,13 +82,19 @@ function nh_init_board(params){ var editor = params.kindutil.create(params.textarea, { // allowPreviewEmoticons : false, // allowImageUpload : false, + autoHeightMode : true, resizeType : 1,minWidth:"1px",width:"560px",height:"150px", allowFileManager:true,uploadJson:"/kindeditor/upload", fileManagerJson:"/kindeditor/filemanager", afterChange:function(){//按键事件 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); +// var edit = this.edit; +// var body = edit.doc.body; +// edit.iframe.height(minHeight); +// this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight)); }, afterCreate:function(){ + this.loadPlugin("autoheight"); var userAgent = navigator.userAgent.toLowerCase(); if(/trident/.test(userAgent)){ $("div.talk_new .ke-container").css({'margin-left':'0px'}); From faf5f1eab5cc9208d4acc02d168c45e5c25dc424 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 9 Sep 2015 09:52:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=80=9A=E8=BF=87=20kindeditor=5Ftag=20f.k?= =?UTF-8?q?indeditor=E7=94=9F=E4=BA=A7=E7=9A=84=E7=BC=96=E8=BE=91=E6=A1=86?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=8A=A8=E9=95=BF=E9=AB=98=E7=BC=A9?= =?UTF-8?q?=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rails_kindeditor/lib/rails_kindeditor/helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index c9908d80f..6ed45d92e 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -7,7 +7,9 @@ module RailsKindeditor input_html = input_html.merge(style: 'display:none') output = ActiveSupport::SafeBuffer.new output << text_area_tag(name, content, input_html) - output << javascript_tag(js_replace(id, options.merge(window_onload: 'true'))) + output << javascript_tag(js_replace(id, options.merge(window_onload: 'true', + :autoHeightMode=>true, + afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})'))) end def kindeditor(name, method, options = {})