mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
Have Escape always close command line/leaderboard
This commit is contained in:
parent
b5d5a18984
commit
cd2761029e
2 changed files with 7 additions and 6 deletions
|
@ -1766,17 +1766,17 @@ $("#commandLine input").keyup((e) => {
|
|||
$(document).ready((e) => {
|
||||
$(document).keydown((event) => {
|
||||
//escape
|
||||
if (
|
||||
(event.keyCode == 27 && !config.swapEscAndTab) ||
|
||||
(event["keyCode"] == 9 && config.swapEscAndTab)
|
||||
) {
|
||||
if (event.keyCode == 27 || (event.keyCode == 9 && config.swapEscAndTab)) {
|
||||
event.preventDefault();
|
||||
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")) {
|
||||
} else if (
|
||||
$("#commandLineWrapper").hasClass("hidden") &&
|
||||
(event.keyCode == 9 || !config.swapEscAndTab)
|
||||
) {
|
||||
if (config.singleListCommandLine == "on")
|
||||
useSingleListCommandLine(false);
|
||||
else currentCommands = [commands];
|
||||
|
|
|
@ -4565,7 +4565,8 @@ function handleTab(event) {
|
|||
!$(".pageLogin").hasClass("active") &&
|
||||
!resultCalculating &&
|
||||
$("#commandLineWrapper").hasClass("hidden") &&
|
||||
$("#simplePopupWrapper").hasClass("hidden")
|
||||
$("#simplePopupWrapper").hasClass("hidden") &&
|
||||
$("#leaderboardsWrapper").hasClass("hidden")
|
||||
) {
|
||||
event.preventDefault();
|
||||
if ($(".pageTest").hasClass("active")) {
|
||||
|
|
Loading…
Reference in a new issue