mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-05 21:15:26 +08:00
added new function to clear funbox
This commit is contained in:
parent
b49d490cc1
commit
8bffd349e1
3 changed files with 13 additions and 2 deletions
|
@ -13,7 +13,7 @@ export const page = new Page(
|
|||
"/",
|
||||
async () => {
|
||||
TestLogic.restart();
|
||||
Funbox.activate("none");
|
||||
Funbox.clear();
|
||||
TestConfig.hide();
|
||||
$("#wordsInput").focusout();
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue