diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-07-24 20:32:52 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-07-24 20:32:52 +0200 |
| commit | d735b4c84034db7032b68886c770bcbd3594b6e8 (patch) | |
| tree | bdf60d16149ced3e6ce92802a8e314c19cb8e9da /assets | |
| parent | 6d7e4baaee72d660c18022ca0fb7aef8c03235f9 (diff) | |
| download | gohugo-theme-ed-d735b4c84034db7032b68886c770bcbd3594b6e8.tar.gz | |
Improve annotation handler
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/js/ed.js | 4 |
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'; |
