]> source.dussan.org Git - nextcloud-server.git/commitdiff
Modified how the #lostpassword or #email fields save email addresses on the Personal...
authorDavid Reagan <reagand@lanecc.edu>
Tue, 16 Apr 2013 20:03:41 +0000 (13:03 -0700)
committerDavid Reagan <reagand@lanecc.edu>
Tue, 16 Apr 2013 20:03:41 +0000 (13:03 -0700)
settings/js/personal.js

index d0a471e56b57b5cf8ff0cb35ad6da349804e761b..9c960a180a14a895f62cb9d3a54d15de7890c9cd 100644 (file)
@@ -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();