From 520b8e13a131bb8fbb74b73f37ff617812dd677e Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 7 Dec 2020 17:34:41 +0000 Subject: [PATCH] forcing letter highlight for nospace funbox --- src/js/script.js | 1 + src/js/userconfig.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/js/script.js b/src/js/script.js index cf73ef3b3..984571b2d 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -349,6 +349,7 @@ function activateFunbox(funbox, mode) { } } else if (funbox === "nospace") { $("#words").addClass("nospace"); + setHighlightMode("letter", true); restartTest(false, true); } activeFunBox = funbox; diff --git a/src/js/userconfig.js b/src/js/userconfig.js index 4c9094591..972d9b34e 100644 --- a/src/js/userconfig.js +++ b/src/js/userconfig.js @@ -768,6 +768,10 @@ function toggleShowLiveWpm() { } function setHighlightMode(mode, nosave) { + if (activeFunBox === "nospace" && mode === "word") { + Misc.showNotification("Can't use word highlight with nospace funbox", 3000); + return; + } if (mode == null || mode == undefined) { mode = "letter"; }