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 @@
* 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();
......
Markdown is supported
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