mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 03:50:45 +08:00
Fix #556
This commit is contained in:
parent
ec41c63f49
commit
9122a0d12a
2 changed files with 19 additions and 3 deletions
|
@ -872,7 +872,14 @@ function showWords() {
|
|||
updateHighlightedKeymapKey();
|
||||
}
|
||||
|
||||
updateActiveElement();
|
||||
updateCaretPosition();
|
||||
}
|
||||
|
||||
$("#restartTestButton, #startTestButton").on("click", function () {
|
||||
console.log("click");
|
||||
if (activeFunBox === "memory") {
|
||||
console.log("activate timer", window.location.pathname);
|
||||
memoryFunboxInterval = clearInterval(memoryFunboxInterval);
|
||||
memoryFunboxTimer = Math.round(Math.pow(wordsList.length, 1.2));
|
||||
memoryFunboxInterval = setInterval(() => {
|
||||
|
@ -885,10 +892,18 @@ function showWords() {
|
|||
}
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
updateActiveElement();
|
||||
updateCaretPosition();
|
||||
}
|
||||
(function (history) {
|
||||
var pushState = history.pushState;
|
||||
history.pushState = function (state) {
|
||||
if (activeFunBox === "memory" && state !== "/") {
|
||||
memoryFunboxInterval = clearInterval(memoryFunboxInterval);
|
||||
memoryFunboxTimer = null;
|
||||
}
|
||||
return pushState.apply(history, arguments);
|
||||
};
|
||||
})(window.history);
|
||||
|
||||
function updateActiveElement() {
|
||||
let active = document.querySelector("#words .active");
|
||||
|
|
|
@ -772,6 +772,7 @@
|
|||
</div>
|
||||
<div id="menu">
|
||||
<div
|
||||
id="startTestButton"
|
||||
class="icon-button view-start"
|
||||
tabindex="2"
|
||||
href="/"
|
||||
|
|
Loading…
Reference in a new issue