added new function to clear funbox

This commit is contained in:
Miodec 2022-02-11 20:34:32 +01:00
parent b49d490cc1
commit 8bffd349e1
3 changed files with 13 additions and 2 deletions

View file

@ -13,7 +13,7 @@ export const page = new Page(
"/",
async () => {
TestLogic.restart();
Funbox.activate("none");
Funbox.clear();
TestConfig.hide();
$("#wordsInput").focusout();
},

View file

@ -92,6 +92,17 @@ export function setFunbox(funbox, mode) {
return true;
}
export async function clear() {
$("#funBoxTheme").attr("href", ``);
$("#words").removeClass("nospace");
$("#words").removeClass("arrows");
reset();
$("#wordsWrapper").removeClass("hidden");
ManualRestart.set();
ModesNotice.update();
return true;
}
export async function activate(funbox) {
let mode = modeSaved;

View file

@ -456,7 +456,7 @@ export function restart(
"Sorry, this funbox won't work with repeated tests.",
0
);
await Funbox.activate("none");
await Funbox.clear();
} else {
await Funbox.activate();
}