Commit 6d812ada authored by David Reagan's avatar David Reagan
Browse files

Modified how the #lostpassword or #email fields save email addresses on the...

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.
parent 2040f0af
...@@ -4,6 +4,24 @@ ...@@ -4,6 +4,24 @@
* See the COPYING-README file. * 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(){ $(document).ready(function(){
$("#passwordbutton").click( function(){ $("#passwordbutton").click( function(){
if ($('#pass1').val() != '' && $('#pass2').val() != '') { if ($('#pass1').val() != '' && $('#pass2').val() != '') {
...@@ -62,18 +80,12 @@ $(document).ready(function(){ ...@@ -62,18 +80,12 @@ $(document).ready(function(){
}); });
$('#lostpassword #email').blur(function(event){ $('#lostpassword #email').keyup(function(){
if ($(this).val() == this.defaultValue){ if(typeof timeout !== 'undefined'){
return; clearTimeout(timeout);
} }
event.preventDefault(); timeout = setTimeout('changeEmailAddress()',1000);
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);
});
});
$("#languageinput").chosen(); $("#languageinput").chosen();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment