removed dependency by moving code

This commit is contained in:
Miodec 2022-02-11 01:40:08 +01:00
parent 7b599a2465
commit 1f82d9dff1
2 changed files with 8 additions and 4 deletions

View file

@ -138,3 +138,10 @@ $("#customTestDurationPopup input").keyup((e) => {
$("#customTestDurationPopup .button").click(() => {
apply();
});
$(document).on("click", "#top .config .time .text-button", (e) => {
let mode = $(e.currentTarget).attr("timeConfig");
if (mode == "custom") {
show();
}
});

View file

@ -1,4 +1,3 @@
import * as CustomTestDurationPopup from "../popups/custom-test-duration-popup";
import Config, * as UpdateConfig from "../config";
import * as ManualRestart from "./manual-restart-tracker";
import * as TestLogic from "./test-logic";
@ -172,9 +171,7 @@ $(document).on("click", "#top .config .wordCount .text-button", (e) => {
$(document).on("click", "#top .config .time .text-button", (e) => {
let mode = $(e.currentTarget).attr("timeConfig");
if (mode == "custom") {
CustomTestDurationPopup.show();
} else {
if (mode != "custom") {
UpdateConfig.setTimeConfig(mode);
ManualRestart.set();
TestLogic.restart();