From f515dc3944657629211db3b5761310afbad43c12 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Wed, 15 Feb 2023 19:32:05 +0300 Subject: [PATCH] perf(web): return to home page when pressed escape on auth page --- web/public/js/auth.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/public/js/auth.js b/web/public/js/auth.js index 7f82b8b..ddc780e 100644 --- a/web/public/js/auth.js +++ b/web/public/js/auth.js @@ -24,3 +24,14 @@ $("#auth").on("submit", function submit(e) { } }); }); + +$(document).keyup(function (e) { + switch (e.key) { + case "Esc": + case "Escape": + location.href = "/"; + break; + default: + return; + } +});