diff --git a/src/js/dom-util.js b/src/js/dom-util.js index 303373897..b49589485 100644 --- a/src/js/dom-util.js +++ b/src/js/dom-util.js @@ -236,3 +236,9 @@ export function updateTestModesNotice( ); } } + +function focusWords() { + if (!$("#wordsWrapper").hasClass("hidden")) { + $("#wordsInput").focus(); + } +} diff --git a/src/js/global-dependencies.js b/src/js/global-dependencies.js index b5e3d0dda..5acfc7a14 100644 --- a/src/js/global-dependencies.js +++ b/src/js/global-dependencies.js @@ -15,6 +15,7 @@ import { swapElements, accountIconLoading, updateTestModesNotice, + focusWords, } from "./dom-util"; import * as Misc from "./misc"; import * as CloudFunctions from "./cloud-functions"; diff --git a/src/js/script.js b/src/js/script.js index 6e2168045..fd801103a 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -2885,12 +2885,6 @@ function restartTest(withSameWordset = false, nosave = false, event) { ); } -function focusWords() { - if (!$("#wordsWrapper").hasClass("hidden")) { - $("#wordsInput").focus(); - } -} - function changePage(page) { if (pageTransition) { return;