Guest User

Untitled

a guest
Apr 25th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Add the clickback code to the success handler
  2. ajaxifyLoginForm: function(){
  3. $('#facebox .new_user_session').submit(function(){
  4. var me = $(this);
  5. $.ajax({
  6. type: 'POST',
  7. url: $(this).attr('action'),
  8. data: $(this).serialize(),
  9. dataType: 'html',
  10. success: function(data) {
  11. // If the user was trying to do click something and then logged in successfully...
  12. if(MyApp.$clickback)
  13. MyApp.$clickback.click();
  14. else
  15. window.location = '/account';
  16. },
  17. error: function(xhr) {}
  18. });
  19. return false;
  20. });
  21. }
Add Comment
Please, Sign In to add comment