From f455db5d6f8aaf17f6a80ad69ef84750583ce121 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 24 Jul 2022 21:09:36 +0200 Subject: Do not refresh page on hypothesis-link click --- assets/js/ed.js | 7 +++++++ layouts/partials/sidebar.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/js/ed.js b/assets/js/ed.js index 146ab58..e3b844a 100644 --- a/assets/js/ed.js +++ b/assets/js/ed.js @@ -24,4 +24,11 @@ document.addEventListener('DOMContentLoaded', function () { document.getElementsByTagName('head')[0].appendChild(script); }); } + + const hypothesisLink = document.querySelector('#hypothesis-link'); + if (hypothesisLink !== null) { + hypothesisContainer.addEventListener('click', (e) => { + e.preventDefault(); + }); + } }); diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 22c8405..7df1a2a 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -23,7 +23,7 @@ {{- end }} - + {{ i18n "annotate" }} -- cgit v1.2.3