Commit bf1c66368dbb9e74de5cda7aeec907396948abc9
1 parent
5e92b217
Exists in
master
and in
7 other branches
Add loading div for signup
Showing
3 changed files
with
15 additions
and
0 deletions
Show diff stats
index.html
js/main.js
... | ... | @@ -660,6 +660,12 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
660 | 660 | var message = $('.signup .message'); |
661 | 661 | message.hide(); |
662 | 662 | message.text(''); |
663 | + | |
664 | + var signup = $(this).parents('form.signup'); | |
665 | + var loading = $('.login-container .loading'); | |
666 | + loading.show(); | |
667 | + signup.hide(); | |
668 | + | |
663 | 669 | $.ajax({ |
664 | 670 | type: 'post', |
665 | 671 | url: host + '/api/v1/register', |
... | ... | @@ -669,6 +675,9 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
669 | 675 | }).fail(function( /*data*/ ) { |
670 | 676 | message.show(); |
671 | 677 | message.text('Não foi possível efetuar o cadastro'); |
678 | + }).always(function() { | |
679 | + loading.hide(); | |
680 | + signup.show(); | |
672 | 681 | }); |
673 | 682 | e.preventDefault(); |
674 | 683 | }); | ... | ... |