summaryrefslogtreecommitdiffstats
path: root/assets/js
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-24 20:32:52 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-24 20:32:52 +0200
commitd735b4c84034db7032b68886c770bcbd3594b6e8 (patch)
treebdf60d16149ced3e6ce92802a8e314c19cb8e9da /assets/js
parent6d7e4baaee72d660c18022ca0fb7aef8c03235f9 (diff)
downloadgohugo-theme-ed-d735b4c84034db7032b68886c770bcbd3594b6e8.tar.gz
Improve annotation handler
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/ed.js4
1 files changed, 3 insertions, 1 deletions
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';