mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 23:07:25 +08:00
Merge pull request #805 from SeerLite/esc-fix-2
Have Esc always close commandline/leaderboards (final fix)
This commit is contained in:
commit
b502c29b2f
2 changed files with 17 additions and 21 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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")) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue