summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2014-01-23 08:03:22 -0800
committerJan-Christoph Borchardt <hey@jancborchardt.net>2014-01-23 08:03:22 -0800
commit5956277ed4db26f46f14eed4a6805038001dde30 (patch)
treeee763f1873fca2fd52560fa9d17b3f76eca3a573 /settings
parent0daabe5b6a2f96e8b754c2414bb83d00277a307a (diff)
parent80dead5a9fe26e14a8b3621eab9c867a27f994d3 (diff)
downloadnextcloud-server-5956277ed4db26f46f14eed4a6805038001dde30.tar.gz
nextcloud-server-5956277ed4db26f46f14eed4a6805038001dde30.zip
Merge pull request #6234 from owncloud/change-email-by-enter
change mail address by pressing enter - fixes #6179
Diffstat (limited to 'settings')
-rw-r--r--settings/js/personal.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 591eb8abe2e..aa55832469c 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -165,6 +165,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);
}
@@ -172,6 +177,18 @@ $(document).ready(function(){
}
});
+ $('#email').keypress(function(event){
+ // 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
+ if(typeof timeout !== 'undefined'){
+ clearTimeout(timeout);
+ }
+ changeEmailAddress();
+ }
+ });
+
$("#languageinput").change( function(){
// Serialize the data
var post = $( "#languageinput" ).serialize();