change mail address by pressing enter - fixes #6179

This commit is contained in:
Morris Jobke 2013-12-07 17:33:27 +01:00
parent 823c85e65f
commit 44a55056e7
1 changed files with 12 additions and 0 deletions

View File

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