logintoboggan.unifiedlogin.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. (function ($) {
  2. Drupal.behaviors.unifiedLogin = {
  3. attach: function (context) {
  4. // Attach behaviors to the links so that they show/hide forms appropriately.
  5. $('.toboggan-unified #register-link').click(function() {
  6. $(this).addClass('lt-active').blur();
  7. $('.toboggan-unified #login-link').removeClass('lt-active');
  8. $('.toboggan-unified #register-form').show();
  9. $('.toboggan-unified #login-form').hide();
  10. return false;
  11. });
  12. $('.toboggan-unified #login-link').click(function() {
  13. $(this).addClass('lt-active').blur();
  14. $('.toboggan-unified #register-link').removeClass('lt-active');
  15. $('.toboggan-unified #login-form').show();
  16. $('.toboggan-unified #register-form').hide();
  17. return false;
  18. });
  19. switch(Drupal.settings.LoginToboggan.unifiedLoginActiveForm) {
  20. case 'register':
  21. $('.toboggan-unified #register-link').click();
  22. break;
  23. case 'login':
  24. default:
  25. $('.toboggan-unified #login-link').click();
  26. break;
  27. }
  28. }
  29. };
  30. })(jQuery);