kindeditor界面打开时,有一个这个界面的过渡

This commit is contained in:
guange 2015-05-21 16:05:42 +08:00
parent 689ec5cdfc
commit eb73ba0b43
1 changed files with 2 additions and 0 deletions

View File

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