From 8c386d06c34f665e0dc0d128a0c9f2d9a5c82a94 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 24 Nov 2021 02:09:35 -0500 Subject: Let's try adding an event listener --- templates/page.tmpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/page.tmpl b/templates/page.tmpl index b0cafcd0..14c7fa40 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -353,9 +353,8 @@ transcriptDiv.appendChild(transcriptLink) } } } -document.addEventListener('DOMContentLoaded', function() { - document.querySelectorAll('track[kind=chapters]').forEach(function(e) { displayChapters(e); }); -}, false); + + document.querySelectorAll('track[kind=chapters]').forEach(function(e) { e.addEventListener('load', displayChapters); }); // @license-end -- cgit v1.2.3