Merge pull request #6234 from owncloud/change-email-by-enter
change mail address by pressing enter - fixes #6179
This commit is contained in:
commit
5956277ed4
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue