From d735b4c84034db7032b68886c770bcbd3594b6e8 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 24 Jul 2022 20:32:52 +0200 Subject: Improve annotation handler --- assets/js/ed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'assets') diff --git a/assets/js/ed.js b/assets/js/ed.js index 19b2c96..3a4b776 100644 --- a/assets/js/ed.js +++ b/assets/js/ed.js @@ -15,7 +15,9 @@ document.addEventListener('DOMContentLoaded', function () { // Annotation support const hypothesisContainer = document.querySelector('.hypothesis-container'); if (hypothesisContainer !== null) { - hypothesisContainer.addEventListener('click', () => { + hypothesisContainer.addEventListener('click', (e) => { + e.preventDefault(); + let script = document.createElement('script'); script.setAttribute('src', 'https://hypothes.is/embed.js'); script.type = 'text/javascript'; -- cgit v1.2.3