From 44a55056e7b6dc505af7f8a0a6f7b33bd0dcacb8 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sat, 7 Dec 2013 17:33:27 +0100 Subject: [PATCH 1/3] change mail address by pressing enter - fixes #6179 --- settings/js/personal.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/settings/js/personal.js b/settings/js/personal.js index 2934677f25..7b9268ca81 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -171,6 +171,18 @@ $(document).ready(function(){ } }); + $('#email').keypress(function(event){ + // check for enter key and non empyt email + if (event.keyCode === 13 && $('#email').val() !== '' ){ + event.preventDefault() + // clear timeout of previous keyup event - prevents duplicate changeEmailAddress call + if(typeof timeout !== 'undefined'){ + clearTimeout(timeout); + } + changeEmailAddress(); + } + }); + $("#languageinput").change( function(){ // Serialize the data var post = $( "#languageinput" ).serialize(); From bc23f46198168c80cc1aab3ae386687b4ce1ec49 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 9 Dec 2013 16:05:10 +0100 Subject: [PATCH 2/3] fix typo --- settings/js/personal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/js/personal.js b/settings/js/personal.js index 7b9268ca81..010f0fc0a7 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -172,7 +172,7 @@ $(document).ready(function(){ }); $('#email').keypress(function(event){ - // check for enter key and non empyt email + // check for enter key and non empty email if (event.keyCode === 13 && $('#email').val() !== '' ){ event.preventDefault() // clear timeout of previous keyup event - prevents duplicate changeEmailAddress call From 80dead5a9fe26e14a8b3621eab9c867a27f994d3 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sat, 18 Jan 2014 22:59:49 +0100 Subject: [PATCH 3/3] fix double call of changeEmailAddress() --- settings/js/personal.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/settings/js/personal.js b/settings/js/personal.js index 010f0fc0a7..576a425ce5 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -164,6 +164,11 @@ $(document).ready(function(){ $('#email').keyup(function(){ if ($('#email').val() !== '' ){ + // if this is the enter key changeEmailAddress() is already invoked + // so it doesn't need to be triggered again + if(event.keyCode === 13) { + return; + } if(typeof timeout !== 'undefined'){ clearTimeout(timeout); }