Added fuctionality of form submit by enter key in Wikidata Login dialogue
@@ -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",
