Commit 10e1c98ce1f50dba7a5fce35e4c08226f1def8e2

Authored by Evandro Junior
1 parent 1a7a550a

Reloading captcha in case of bad registration

Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
js/main.js
... ... @@ -1143,6 +1143,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun
1143 1143 $(document).on('click', '.new-user', function(e) {
1144 1144 var loginForm = $(this).parents('#login-form');
1145 1145 var signupForm = loginForm.siblings('#signup-form');
  1146 + window.signupForm = signupForm;
1146 1147 console.log("novo usuário");
1147 1148 loginForm.hide();
1148 1149 signupForm.show();
... ... @@ -1187,6 +1188,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun
1187 1188 $(document).trigger('login:success', data);
1188 1189 }).fail(function(data) {
1189 1190 var msg = "";
  1191 + window.signupForm.find('#g-recaptcha').empty();
  1192 + Recaptcha.create(window.recaptchaSiteKey, window.signupForm.find('#g-recaptcha')[0], { lang : 'pt', theme: "clean", callback: Recaptcha.focus_response_field } );
  1193 +
1190 1194 try{
1191 1195 msg = Main.responseToText(data.responseJSON.message);
1192 1196 }catch(ex){
... ...