removed dependency by moving click handler

part of #2462
This commit is contained in:
Miodec 2022-02-11 14:01:08 +01:00
parent bf3ad6be2a
commit b0bc26c90c
2 changed files with 10 additions and 12 deletions

View file

@ -175,6 +175,16 @@ $(document).keydown((event) => {
}
});
$(document).on("keypress", "#practiseWordsButton", (event) => {
if (event.keyCode == 13) {
showPopup(true);
}
});
$(document.body).on("click", "#practiseWordsButton", () => {
showPopup();
});
$(document).ready(() => {
UpdateConfig.subscribeToEvent((eventKey) => {
if (eventKey === "mode") resetBefore();

View file

@ -7,7 +7,6 @@ import * as TestInput from "./test-input";
import * as CustomText from "./custom-text";
import * as Caret from "./caret";
import * as OutOfFocus from "./out-of-focus";
import * as PractiseWords from "./practise-words";
import * as Replay from "./replay";
import * as Misc from "../misc";
import * as QuoteRatePopup from "../popups/quote-rate-popup";
@ -873,17 +872,6 @@ $("#wordsInput").on("focusout", () => {
Caret.hide();
});
$(document).on("keypress", "#practiseWordsButton", (event) => {
if (event.keyCode == 13) {
PractiseWords.showPopup(true);
}
});
$(document.body).on("click", "#practiseWordsButton", () => {
// PractiseWords.init();
PractiseWords.showPopup();
});
$(document).on("keypress", "#showWordHistoryButton", (event) => {
if (event.keyCode == 13) {
toggleResultWords();