fixed a bug where you could type while leaderobards are visible

This commit is contained in:
Jack 2021-07-06 01:16:38 +01:00
parent 9fe5d76745
commit 77f5277419

View file

@ -828,6 +828,7 @@ $(document).keydown(function (event) {
//autofocus
let pageTestActive = !$(".pageTest").hasClass("hidden");
let commandLineVisible = !$("#commandLineWrapper").hasClass("hidden");
let leaderboardsVisible = !$("#leaderboardsWrapper").hasClass("hidden");
let wordsFocused = $("#wordsInput").is(":focus");
let modePopupVisible =
!$("#customTextPopupWrapper").hasClass("hidden") ||
@ -838,6 +839,7 @@ $(document).keydown(function (event) {
if (
pageTestActive &&
!commandLineVisible &&
!leaderboardsVisible &&
!modePopupVisible &&
!TestUI.resultVisible &&
!wordsFocused &&
@ -893,7 +895,7 @@ $(document).keydown(function (event) {
handleSpace(event, false);
}
if (wordsFocused && !commandLineVisible) {
if (wordsFocused && !commandLineVisible && !leaderboardsVisible) {
handleAlpha(event);
}