Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
hacked up the fckeditor plugin so I can specify the ID attribute on t…
Browse files Browse the repository at this point in the history
…he textarea if it's bound to a resource
  • Loading branch information
James Cook committed Jan 12, 2009
1 parent 468f112 commit 424fda9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vendor/plugins/fckeditor/lib/fckeditor.rb
Expand Up @@ -18,7 +18,7 @@ def fckeditor_textarea(object, field, options = {})
klass = Kernel.const_get("#{object}".camelcase)
instance_variable_set("@#{object}", eval("#{klass}.new()"))
end
id = fckeditor_element_id(object, field)
id = options[:id] || fckeditor_element_id(object, field) # Stupid, awful hack for content_section filters
name = "#{object}[#{field}]"

fckeditor_textarea_tag(name, value, options.merge({:id => id}))
Expand Down Expand Up @@ -81,8 +81,8 @@ def fckeditor_div_id(object, field)
"div-#{object}-#{id}-#{field}-editor"
end

def fckeditor_before_js(object, field)
id = fckeditor_element_id(object, field)
def fckeditor_before_js(object, field, options = {})
id = options[:id] || fckeditor_element_id(object, field) # I really need to set the ID ..
"var oEditor = FCKeditorAPI.GetInstance('"+id+"'); document.getElementById('"+id+"_hidden').value = oEditor.GetXHTML();"
end
end
Expand Down

0 comments on commit 424fda9

Please sign in to comment.