Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow passing of options to TinyMCE form fields via the column option…

…s tinymce hash
  • Loading branch information...
commit 69b400c4c817338a039a419e7f45e2fd958c6c58 1 parent dea6436
Center for Inquiry centerforinquiry authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/active_scaffold/bridges/tiny_mce/helpers.rb
7 lib/active_scaffold/bridges/tiny_mce/helpers.rb
View
@@ -14,9 +14,14 @@ def self.included(base)
def active_scaffold_input_text_editor(column, options)
options[:class] = "#{options[:class]} mceEditor #{column.options[:class]}".strip
+
+ settings = column.options[:tinymce] || { theme: 'simple' }
+ settings = settings.to_s.gsub(/:(.+?)\=\>/, '\1:')
+ settings = "tinyMCE.settings = #{settings};"
+
html = []
html << send(override_input(:textarea), column, options)
- html << javascript_tag("tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? || params[:iframe]
+ html << javascript_tag(settings + "tinyMCE.execCommand('mceAddControl', false, '#{options[:id]}');") if request.xhr? || params[:iframe]
html.join "\n"
end
Please sign in to comment.
Something went wrong with that request. Please try again.