From eacf044f07cd5b08298d7f7233c16e20d77f861c Mon Sep 17 00:00:00 2001 From: Gerome Matilla Date: Thu, 4 Jun 2020 16:28:48 +0800 Subject: [PATCH] escape button will close opened screens/panel --- js/keybindings.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/keybindings.js b/js/keybindings.js index 130f045..10f513a 100644 --- a/js/keybindings.js +++ b/js/keybindings.js @@ -23,13 +23,19 @@ document.addEventListener( if (event.key === 'Escape') { - // If searchbox is visible, hide and clear input field + // If any of this are open, close it if (searchBoxVisility) { // Hide searchbox toggleSearchBox(); searchBox.value = ''; return; - }; + } else if (weatherScreenVisibility) { + toggleWeatherScreen(); + return; + } else if (rightDashboardVisibility) { + toggleDashboard(); + return; + } // Show web menu toggleWebMenu();