diff options
Diffstat (limited to 'views/default/js/walled_garden.php')
-rw-r--r-- | views/default/js/walled_garden.php | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php index 46c2934ff..e761e5869 100644 --- a/views/default/js/walled_garden.php +++ b/views/default/js/walled_garden.php @@ -15,25 +15,31 @@ $cancel_button = trim($cancel_button); $(document).ready(function() { - // add cancel button to inline forms - $(".elgg-walledgarden-password").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); - $('.elgg-walledgarden-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); - - $(".forgot_link").click(function(event) { + $('.forgot_link').click(function(event) { + $.get('walled_garden/lost_password', function(data) { + $('.elgg-walledgarden-double').fadeToggle(); + $('.elgg-body-walledgarden').append(data); + $(".elgg-form-user-requestnewpassword").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + $('.elgg-walledgarden-single').fadeToggle(); + }); event.preventDefault(); - $(".elgg-walledgarden-password").fadeToggle(); }); - $(".registration_link").click(function(event) { + $('.registration_link').click(function(event) { + $.get('walled_garden/register', function(data) { + $('.elgg-walledgarden-double').fadeToggle(); + $('.elgg-body-walledgarden').append(data); + $('.elgg-form-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + $('.elgg-walledgarden-single').fadeToggle(); + }); event.preventDefault(); - $(".elgg-walledgarden-register").fadeToggle(); }); - $('input.elgg-button-cancel').click(function(event) { - if ($(".elgg-walledgarden-password").is(':visible')) { - $(".forgot_link").click(); - } else if ($('.elgg-walledgarden-register').is(':visible')) { - $(".registration_link").click(); + $('input.elgg-button-cancel').live('click', function(event) { + if ($('.elgg-walledgarden-single').is(':visible')) { + $('.elgg-walledgarden-double').fadeToggle(); + $('.elgg-walledgarden-single').fadeToggle(); + $('.elgg-walledgarden-single').remove(); } event.preventDefault(); }); |