From 015f7db29d084b7961082253cda6ee74251435f3 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Mon, 5 Apr 2021 18:08:33 -0400 Subject: [PATCH] Don't quick tab restart when command line is open --- src/js/input-controller.js | 53 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/js/input-controller.js b/src/js/input-controller.js index b3d828dd7..8df4b1924 100644 --- a/src/js/input-controller.js +++ b/src/js/input-controller.js @@ -52,40 +52,41 @@ function handleTab(event) { // ); return; } else if ( - $(".pageTest").hasClass("active") && !TestUI.resultCalculating && $("#commandLineWrapper").hasClass("hidden") && $("#simplePopupWrapper").hasClass("hidden") ) { - if (Config.quickTab) { - if (Config.mode == "zen" && !event.shiftKey) { - //ignore - } else { - if (event.shiftKey) ManualRestart.set(); - - if ( - TestLogic.active && - Config.repeatQuotes === "typing" && - Config.mode === "quote" - ) { - TestLogic.restart(true, false, event); + if ($(".pageTest").hasClass("active")) { + if (Config.quickTab) { + if (Config.mode == "zen" && !event.shiftKey) { + //ignore } else { - TestLogic.restart(false, false, event); + if (event.shiftKey) ManualRestart.set(); + + if ( + TestLogic.active && + Config.repeatQuotes === "typing" && + Config.mode === "quote" + ) { + TestLogic.restart(true, false, event); + } else { + TestLogic.restart(false, false, event); + } + } + } else { + if ( + !TestUI.resultVisible && + ((TestLogic.hasTab && event.shiftKey) || + (!TestLogic.hasTab && Config.mode !== "zen") || + (Config.mode === "zen" && event.shiftKey)) + ) { + event.preventDefault(); + $("#restartTestButton").focus(); } } - } else { - if ( - !TestUI.resultVisible && - ((TestLogic.hasTab && event.shiftKey) || - (!TestLogic.hasTab && Config.mode !== "zen") || - (Config.mode === "zen" && event.shiftKey)) - ) { - event.preventDefault(); - $("#restartTestButton").focus(); - } + } else if (Config.quickTab) { + UI.changePage("test"); } - } else if (Config.quickTab) { - UI.changePage("test"); } }