浏览代码

Add onLoad callback to reCAPTCHA service

Felipe 6 年之前
父节点
当前提交
5a4d0841a8
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tarteaucitron.services.js

+ 2 - 1
tarteaucitron.services.js

@@ -1300,8 +1300,9 @@ tarteaucitron.services.recaptcha = {
     "cookies": ['nid'],
     "js": function () {
         "use strict";
+        window.tacRecaptchaOnLoad = tarteaucitron.user.recaptchaOnLoad || function() {};
         tarteaucitron.fallback(['g-recaptcha'], '');
-        tarteaucitron.addScript('https://www.google.com/recaptcha/api.js');
+        tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad');
     },
     "fallback": function () {
         "use strict";