From feecc13134515b1e892ffea7905718120e66aa3e Mon Sep 17 00:00:00 2001 From: benjl Date: Fri, 29 Nov 2024 17:17:10 -0500 Subject: [PATCH] Console error - doSearch is not defined #4074 --- index.html | 6 ++++-- js/activity.js | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 220a2ecf07..0c8f7e3bd7 100644 --- a/index.html +++ b/index.html @@ -109,8 +109,10 @@ } diff --git a/js/activity.js b/js/activity.js index 4c161ff194..6b1cb3e1e1 100644 --- a/js/activity.js +++ b/js/activity.js @@ -198,6 +198,7 @@ class Activity { */ constructor() { globalActivity = this; + window.globalActivity = this; this.cellSize = 55; this.searchSuggestions = []; @@ -6949,10 +6950,14 @@ class Activity { const activity = new Activity(); -require(["domReady!"], (doc) =>{ +require(["domReady!"], (doc) => { setTimeout(() => { activity.setupDependencies(); activity.domReady(doc); + + // Dispatch a custom event to signal that globalActivity is ready + const event = new CustomEvent('globalActivityReady'); + document.dispatchEvent(event); }, 5000); });