From d7f4ac0ebbd01e273cc1fa6835fa95b5fa97f7ff Mon Sep 17 00:00:00 2001 From: Eryk Kulikowski Date: Fri, 29 Sep 2023 18:29:49 +0200 Subject: [PATCH] ro-crate previewer --- previewers/betatest/js/rocrate.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/previewers/betatest/js/rocrate.js b/previewers/betatest/js/rocrate.js index 79832e1..d4bbd47 100644 --- a/previewers/betatest/js/rocrate.js +++ b/previewers/betatest/js/rocrate.js @@ -18,9 +18,8 @@ function writeContentAndData(data, fileUrl, file, title, authors) { s2.type = "text/javascript"; s2.src = "js/ro-crate-dynamic.js"; scripts.append(s2); - dispatchLoad(); -} - -async function dispatchLoad() { - dispatchEvent(new Event('load')); + var s3 = document.createElement("script"); + s3.type = "text/javascript"; + s3.text = `dispatchEvent(new Event('load'));`; + scripts.append(s3); }