diff options
author | David Reagan <reagand@lanecc.edu> | 2013-04-16 13:03:41 -0700 |
---|---|---|
committer | David Reagan <reagand@lanecc.edu> | 2013-04-16 13:03:41 -0700 |
commit | 6d812ada059525772893d3eb5be9c080635c7120 (patch) | |
tree | 30d51d92af2ed892fc2c41aff1ca6a04ebc1f844 /settings/js | |
parent | 2040f0af78bbe73fb477367646183b880348ad86 (diff) | |
download | nextcloud-server-6d812ada059525772893d3eb5be9c080635c7120.tar.gz nextcloud-server-6d812ada059525772893d3eb5be9c080635c7120.zip |
Modified how the #lostpassword or #email fields save email addresses on the Personal settings page. It now saves one second after the last keyup event, instead of after a blur event.
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/personal.js | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index d0a471e56b5..9c960a180a1 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -4,6 +4,24 @@ * See the COPYING-README file. */ +/** + * Post the email address change to the server. + */ +function changeEmailAddress(){ + emailInfo = $('#lostpassword #email'); + console.log("Timout done."); + if (emailInfo.val() === emailInfo.defaultValue){ + return; + } + //event.preventDefault(); + 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 +80,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); - }); - }); + $('#lostpassword #email').keyup(function(){ + if(typeof timeout !== 'undefined'){ + clearTimeout(timeout); + } + timeout = setTimeout('changeEmailAddress()',1000); + }); $("#languageinput").chosen(); |