Skip to content
Permalink
Browse files

Updated translate for onclick

  • Loading branch information...
Breccan committed Dec 2, 2010
1 parent ce2bd8d commit 45ab239bfe12e90c237091de3d6cb82236a342c9
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/translatables_helper.rb
@@ -113,7 +113,8 @@ def raw_locale_links(options = {})
#Translate link for the given locale
def translate_link(translatable, options = {})
options[:params] ||= {}
options[:params][:onclick] = 'update_translation_box(this); return false' if options[:lightbox]
options[:onclick] = 'update_translation_box(this); return false' if options[:lightbox]
options[:onclick] ||= ""
#TODO tidy this up, make lightbox part of the basic params hash.
action = translatable.translation_for(params[:locale]) ? :edit : :new
options[:params][:id] = params[:locale] if action == :edit
@@ -124,7 +125,7 @@ def translate_link(translatable, options = {})
{ :action => action,
:controller => :translations,
translatable_key_from(translatable) => translatable,
:to_locale => params[:locale] }.merge(options[:params]))
:to_locale => params[:locale] }.merge(options[:params]), :onclick => options[:onclick])
end
end

0 comments on commit 45ab239

Please sign in to comment.
You can’t perform that action at this time.