Fix some popups not closing using Esc (#2005) by CrumblyLiquid

* Fix quoteSearchPopup being unresponsive to Esc

* Fix customWordAmountPopup not reacting to Esc

* Fix customTestDurationPopup not reacting to Esc
This commit is contained in:
CrumblyLiquid 2021-10-16 17:42:42 +02:00 committed by GitHub
parent bb10006a0a
commit e33eb4f7f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import * as SimplePopups from "./simple-popups";
import * as CustomWordAmountPopup from "./custom-word-amount-popup";
import * as CustomTestDurationPopup from "./custom-test-duration-popup";
import * as CustomTextPopup from "./custom-text-popup";
import * as QuoteSearchPopupWrapper from "./quote-search-popup";
let commandLineMouseMode = false;
@ -360,6 +361,9 @@ $(document).ready((e) => {
} else if (!$("#customTextPopupWrapper").hasClass("hidden")) {
event.preventDefault();
CustomTextPopup.hide();
} else if (!$("#quoteSearchPopupWrapper").hasClass("hidden")) {
event.preventDefault();
QuoteSearchPopupWrapper.hide();
} else if (!$("#commandLineWrapper").hasClass("hidden")) {
if (CommandlineLists.current.length > 1) {
CommandlineLists.current.pop();

View file

@ -81,7 +81,7 @@ export function show() {
previewDuration();
}
function hide() {
export function hide() {
if (!$("#customTestDurationPopupWrapper").hasClass("hidden")) {
$("#customTestDurationPopupWrapper")
.stop(true, true)

View file

@ -15,7 +15,7 @@ export function show() {
}
}
function hide() {
export function hide() {
if (!$("#customWordAmountPopupWrapper").hasClass("hidden")) {
$("#customWordAmountPopupWrapper")
.stop(true, true)