This commit is contained in:
a1usha 2020-11-09 19:08:05 +07:00
parent ec41c63f49
commit 9122a0d12a
2 changed files with 19 additions and 3 deletions

View file

@ -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");

View file

@ -772,6 +772,7 @@
</div>
<div id="menu">
<div
id="startTestButton"
class="icon-button view-start"
tabindex="2"
href="/"