FIX: can't close leaderboards using keyboard (Esc)

This commit is contained in:
willerbee 2020-10-13 16:19:43 +08:00 committed by GitHub
parent c6a7d934ef
commit 6144b52e0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1351,7 +1351,11 @@ $(document).ready((e) => {
//escape
if ((event.keyCode == 27 && !config.swapEscAndTab) || (event["keyCode"] == 9 && config.swapEscAndTab)) {
event.preventDefault();
if ($("#commandLineWrapper").hasClass("hidden")) {
if (!$("#leaderboardsWrapper").hasClass("hidden")) { //maybe add more condition for closing other dialogs in the future as well
event.preventDefault();
hideLeaderboards();
return;
} else if ($("#commandLineWrapper").hasClass("hidden")) {
currentCommands = [commands];
showCommandLine();
} else {