diff --git a/app/assets/javascripts/active_admin/active_admin_globalize.js.coffee b/app/assets/javascripts/active_admin/active_admin_globalize.js.coffee index a4cc79ee..46c08777 100644 --- a/app/assets/javascripts/active_admin/active_admin_globalize.js.coffee +++ b/app/assets/javascripts/active_admin/active_admin_globalize.js.coffee @@ -135,8 +135,12 @@ $ -> updateLocaleButtonsStatus($dom) $tabs.filter('.default').click() + $a = $("a") + # jQuery 1.7 introduced "on" and deprecated "bind" + # AA 1.2 bumps jquery-rails to >= 4.2, so we can drop "bind" once AA req is bumped + bindingMethod = if ("on" of $a && typeof $a.on == 'function') then "on" else "bind" # this is to handle elements created with has_many - $("a").bind "click", -> + $a[bindingMethod] "click", -> setTimeout( -> translations() 50