From fb726076e7622c80b3ef24a0d013969a6fbb2cb5 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Thu, 7 Jan 2021 17:39:09 -0300 Subject: [PATCH] Revert "Fix swapEscAndTab sometimes failing on Esc" This reverts commit 4d8ba85b836f5971680aafe810a60768fd305c09. --- src/js/commandline.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/js/commandline.js b/src/js/commandline.js index 6a368674c..ac5ea8d20 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -1777,26 +1777,27 @@ $(document).ready((e) => { 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") && + (event.keyCode == 9 || !config.swapEscAndTab) + ) { + if (config.singleListCommandLine == "on") + useSingleListCommandLine(false); + else currentCommands = [commands]; + showCommandLine(); + } else { + 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); } } }