From eb73ba0b4314bae061e911f5f519c82e2ba64049 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 21 May 2015 16:05:42 +0800 Subject: [PATCH] =?UTF-8?q?kindeditor=E7=95=8C=E9=9D=A2=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9C=89=E4=B8=80=E4=B8=AA=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E8=BF=87=E6=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rails_kindeditor/lib/rails_kindeditor/helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index c3252ed1c..1f4c867ba 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -4,6 +4,7 @@ module RailsKindeditor def kindeditor_tag(name, content = nil, options = {}) id = sanitize_to_id(name) input_html = { :id => id }.merge(options.delete(:input_html) || {}) + 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'))) @@ -12,6 +13,7 @@ module RailsKindeditor def kindeditor(name, method, options = {}) # TODO: Refactory options: 1. kindeditor_option 2. html_option input_html = (options.delete(:input_html) || {}).stringify_keys + input_html = input_html.merge(style: 'display:none') output_buffer = ActiveSupport::SafeBuffer.new output_buffer << build_text_area_tag(name, method, self, options, input_html) output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true')))