Merge pull request #6234 from owncloud/change-email-by-enter

change mail address by pressing enter - fixes #6179
This commit is contained in:
Jan-Christoph Borchardt 2014-01-23 08:03:22 -08:00
commit 5956277ed4
1 changed files with 17 additions and 0 deletions

View File

@ -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();