From 591b533cd20f7ea3d59b2ffc5484b48382c62106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Fri, 7 Feb 2020 16:08:45 +0100 Subject: oops --- js/login.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'js/login.js') diff --git a/js/login.js b/js/login.js index a7ab25c..564214f 100644 --- a/js/login.js +++ b/js/login.js @@ -10,6 +10,14 @@ function setupEventListeners() { $("#login-button").click(function () { login(); }); + window.addEventListener("keyup", function(event) { + // Number 13 is the "Enter" key on the keyboard + if (event.keyCode === 13) { + // Cancel the default action, if needed + event.preventDefault(); + login(); + } +}); } // Handle login button click @@ -58,4 +66,4 @@ function login() { } }) -} \ No newline at end of file +} -- cgit v1.2.3