Merge pull request #805 from SeerLite/esc-fix-2

Have Esc always close commandline/leaderboards (final fix)
This commit is contained in:
Jack 2021-01-09 21:18:39 +00:00 committed by GitHub
commit b502c29b2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 21 deletions

View file

@ -1776,28 +1776,25 @@ $(document).ready((e) => {
//maybe add more condition for closing other dialogs in the future as well
event.preventDefault();
hideLeaderboards();
return;
} else if (event.keyCode == 9 || !config.swapEscAndTab) {
if ($("#commandLineWrapper").hasClass("hidden")) {
if (config.singleListCommandLine == "on")
useSingleListCommandLine(false);
else currentCommands = [commands];
} else if (!$("#commandLineWrapper").hasClass("hidden")) {
if (currentCommands.length > 1) {
currentCommands.pop();
$("#commandLine").removeClass("allCommands");
showCommandLine();
} else {
if (currentCommands.length > 1) {
currentCommands.pop();
$("#commandLine").removeClass("allCommands");
showCommandLine();
} else {
hideCommandLine();
}
setFontFamily(config.fontFamily, true);
if (config.customTheme === true) {
applyCustomThemeColors();
} else {
setTheme(config.theme);
}
hideCommandLine();
}
setFontFamily(config.fontFamily, true);
if (config.customTheme === true) {
applyCustomThemeColors();
} else {
setTheme(config.theme);
}
} else if (event.keyCode == 9 || !config.swapEscAndTab) {
if (config.singleListCommandLine == "on")
useSingleListCommandLine(false);
else currentCommands = [commands];
showCommandLine();
}
}
});

View file

@ -4601,8 +4601,7 @@ function handleTab(event) {
!$(".pageLogin").hasClass("active") &&
!resultCalculating &&
$("#commandLineWrapper").hasClass("hidden") &&
$("#simplePopupWrapper").hasClass("hidden") &&
$("#leaderboardsWrapper").hasClass("hidden")
$("#simplePopupWrapper").hasClass("hidden")
) {
event.preventDefault();
if ($(".pageTest").hasClass("active")) {