Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/Breccan/mongo_translatable:
  Updated translate for onclick
  • Loading branch information
Walter McGinnis committed Dec 2, 2010
2 parents 9af6741 + 45ab239 commit 0a0223e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/translatables_helper.rb
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 0a0223e

Please sign in to comment.