diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-16 13:56:14 -0700 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-16 13:56:14 -0700 |
commit | 70494360584867df05a92b3bc1be6af36b37c2ba (patch) | |
tree | 38343cba56f96ec51fcb1a398a50f917cbc46458 | |
parent | 2040f0af78bbe73fb477367646183b880348ad86 (diff) | |
parent | 0dd6f16e0b57da5239992ceacd90a9c9d01bc9e8 (diff) | |
download | nextcloud-server-70494360584867df05a92b3bc1be6af36b37c2ba.tar.gz nextcloud-server-70494360584867df05a92b3bc1be6af36b37c2ba.zip |
Merge pull request #2953 from jerrac/emailsavetimeout
Modified how the #lostpassword or #email fields save email addresses on ...
-rw-r--r-- | settings/js/personal.js | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index d0a471e56b5..7c879bcafe9 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -4,6 +4,22 @@ * See the COPYING-README file. */ +/** + * Post the email address change to the server. + */ +function changeEmailAddress(){ + emailInfo = $('#email'); + if (emailInfo.val() === emailInfo.defaultValue){ + return; + } + emailInfo.defaultValue = emailInfo.val(); + OC.msg.startSaving('#lostpassword .msg'); + var post = $( "#lostpassword" ).serialize(); + $.post( 'ajax/lostpassword.php', post, function(data){ + OC.msg.finishedSaving('#lostpassword .msg', data); + }); +} + $(document).ready(function(){ $("#passwordbutton").click( function(){ if ($('#pass1').val() != '' && $('#pass2').val() != '') { @@ -62,18 +78,12 @@ $(document).ready(function(){ }); - $('#lostpassword #email').blur(function(event){ - if ($(this).val() == this.defaultValue){ - return; - } - event.preventDefault(); - this.defaultValue = $(this).val(); - OC.msg.startSaving('#lostpassword .msg'); - var post = $( "#lostpassword" ).serialize(); - $.post( 'ajax/lostpassword.php', post, function(data){ - OC.msg.finishedSaving('#lostpassword .msg', data); - }); - }); + $('#email').keyup(function(){ + if(typeof timeout !== 'undefined'){ + clearTimeout(timeout); + } + timeout = setTimeout('changeEmailAddress()',1000); + }); $("#languageinput").chosen(); |