Merge pull request #422 from willerbee/patch-1

FIX: can't close leaderboards using keyboard (Esc)
This commit is contained in:
Jack 2020-10-14 00:42:22 +01:00 committed by GitHub
commit abe781ba25
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 {