From 4fdb2016a3316113eef6edea6decc969f2aff672 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Mon, 28 Aug 2023 17:26:14 -0700 Subject: [PATCH] [JavaScript] Switch from jQuery().ready() to pure JavaScript After [1,2] were merged in openstack/requirements we get a new versions of Sphinx and Docutils. I don't fully understand why but these new versions seem to alter the asynchronous loading behavior sych that when event_timer.js is loaded the jQuery code hasn't been fully initialised. This results in `$(document).ready(setup_timeline);` generating an "uncaught ReferenceError: $ is not defined" JS error. We don't actually need jQuery just a way to detect that the page is loaded to update the event table. This change switches to pure JS to set an onload() function. [1] https://review.opendev.org/c/openstack/requirements/+/891751 [2] https://review.opendev.org/c/openstack/requirements/+/891694 Change-Id: Ia44a55cb7a32fb6ddf9f05ac77bb56921cef446a --- doc/source/_static/event_timer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/_static/event_timer.js b/doc/source/_static/event_timer.js index fc04784f..8e7edb58 100644 --- a/doc/source/_static/event_timer.js +++ b/doc/source/_static/event_timer.js @@ -64,4 +64,4 @@ function setup_timeline() { document.getElementById('eventname').innerHTML = next_events.join(" and ") + ' start in'; } } -$(document).ready(setup_timeline); +window.onload = function () { setup_timeline() }