fixed word highlight and read ahead not liking each other #723

This commit is contained in:
Jack 2020-12-17 16:35:12 +00:00
parent ee4ddc7a17
commit 0757c11d71
2 changed files with 10 additions and 2 deletions

View file

@ -331,6 +331,11 @@ async function activateFunbox(funbox, mode) {
settingsGroups.keymapMode.updateButton();
restartTest();
}
if (funbox === "read_ahead") {
setHighlightMode("letter", true);
restartTest();
}
} else if (mode === "script") {
if (funbox === "tts") {
$("#funBoxTheme").attr("href", `funbox/simon_says.css`);

View file

@ -810,8 +810,11 @@ function toggleShowLiveAcc() {
}
function setHighlightMode(mode, nosave) {
if (activeFunBox === "nospace" && mode === "word") {
Misc.showNotification("Can't use word highlight with nospace funbox", 3000);
if (
mode === "word" &&
(activeFunBox === "nospace" || activeFunBox === "read_ahead")
) {
Misc.showNotification("Can't use word highlight with this funbox", 3000);
return;
}
if (mode == null || mode == undefined) {