Added fuctionality of form submit by enter key in Wikidata Login dialogue
This commit is contained in:
parent
3911636f0d
commit
cfc962668c
@ -70,6 +70,25 @@ ManageAccountDialog.display = function(logged_in_username, saved_credentials, ca
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.keyCode == 13) {
|
||||
frame.hide();
|
||||
Refine.postCSRF(
|
||||
"command/wikidata/login",
|
||||
elmts.loginForm.serialize(),
|
||||
function(data) {
|
||||
if (data.logged_in) {
|
||||
dismiss();
|
||||
callback(data.username);
|
||||
} else {
|
||||
frame.show();
|
||||
elmts.invalidCredentials.text("Invalid credentials.");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
elmts.logoutButton.click(function() {
|
||||
Refine.postCSRF(
|
||||
"command/wikidata/login",
|
||||
|
Loading…
Reference in New Issue
Block a user