From 09f73740e2ca7800aa19c91580e0e23821d75c0c Mon Sep 17 00:00:00 2001 From: Mika Vaara Date: Tue, 21 Jan 2025 16:16:05 +0200 Subject: [PATCH] Moved out of the global scope to local scope and refactored into arrow functions. --- resource/js/tab-alpha.js | 6 +++--- resource/js/vocab-counts.js | 6 +++--- resource/js/vocab-search.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resource/js/tab-alpha.js b/resource/js/tab-alpha.js index 7cc4dfc0a..ae8879666 100644 --- a/resource/js/tab-alpha.js +++ b/resource/js/tab-alpha.js @@ -242,12 +242,12 @@ function startAlphaApp () { tabAlphaApp.mount('#tab-alphabetical') } -function waitForTranslationService () { +const waitForTranslationServiceTabAlpha = () => { if (typeof $t !== 'undefined') { startAlphaApp() } else { - setTimeout(waitForTranslationService, 50) + setTimeout(waitForTranslationServiceTabAlpha, 50) } } -waitForTranslationService() +waitForTranslationServiceTabAlpha() diff --git a/resource/js/vocab-counts.js b/resource/js/vocab-counts.js index 9b069db8c..613060abe 100644 --- a/resource/js/vocab-counts.js +++ b/resource/js/vocab-counts.js @@ -76,12 +76,12 @@ function startResourceCountsApp () { resourceCountsApp.mount('#resource-counts') } -function waitForTranslationService () { +const waitForTranslationServiceVocabCounts = () => { if (typeof $t !== 'undefined') { startResourceCountsApp() } else { - setTimeout(waitForTranslationService, 50) + setTimeout(waitForTranslationServiceVocabCounts, 50) } } -waitForTranslationService() +waitForTranslationServiceVocabCounts() diff --git a/resource/js/vocab-search.js b/resource/js/vocab-search.js index 595372342..e51059f7a 100644 --- a/resource/js/vocab-search.js +++ b/resource/js/vocab-search.js @@ -370,12 +370,12 @@ function startVocabSearchApp () { vocabSearch.mount('#search-vocab') } -function waitForTranslationService () { +const waitForTranslationServiceVocabSearch = () => { if (typeof $t !== 'undefined') { startVocabSearchApp() } else { - setTimeout(waitForTranslationService, 50) + setTimeout(waitForTranslationServiceVocabSearch, 50) } } -waitForTranslationService() +waitForTranslationServiceVocabSearch()