fixed some test modes notices not reacting to clicks properly

This commit is contained in:
Miodec 2021-02-02 19:31:33 +00:00
parent 3921a63b04
commit 0ac4610d29

View file

@ -3760,7 +3760,7 @@ function updateTestModesNotice() {
if (sameWordset) {
$(".pageTest #testModesNotice").append(
`<div class="text-button" onClick="restartTest()" style="color:var(--error-color);"><i class="fas fa-sync-alt"></i>repeated</div>`
`<div class="text-button" function="restartTest()" style="color:var(--error-color);"><i class="fas fa-sync-alt"></i>repeated</div>`
);
}
@ -3793,7 +3793,7 @@ function updateTestModesNotice() {
if (config.blindMode) {
$(".pageTest #testModesNotice").append(
`<div class="text-button" onClick="toggleBlindMode()"><i class="fas fa-eye-slash"></i>blind</div>`
`<div class="text-button" function="toggleBlindMode()"><i class="fas fa-eye-slash"></i>blind</div>`
);
}
@ -4805,12 +4805,15 @@ $(document).mousemove(function (event) {
$(document).on("click", "#testModesNotice .text-button", (event) => {
let commands = eval($(event.currentTarget).attr("commands"));
let func = $(event.currentTarget).attr("function");
if (commands !== undefined) {
if ($(event.currentTarget).attr("commands") === "commandsTags") {
updateCommandsTagsList();
}
currentCommands.push(commands);
showCommandLine();
} else if (func != undefined) {
eval(func);
}
});