From cb9a0101d6fe0fb0e642a9d7aff665d9af03e093 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Mon, 22 Apr 2024 10:46:50 +0000 Subject: [PATCH] Fixed #6: goto content on card click only for Home, not downloads --- assets/dashboard.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/assets/dashboard.js b/assets/dashboard.js index e639f87..86b97ea 100644 --- a/assets/dashboard.js +++ b/assets/dashboard.js @@ -171,18 +171,20 @@ function run() { addClass(document.getElementById('readers-banner'), 'hidden'); }); - live('.hotspot-entry', 'click', function(el, ev){ - ev.preventDefault(); - ev.stopPropagation(); - let target = ''; - if (hasClass(el, 'hotspot-entry')) { - target = el.getAttribute('data-target'); - } else { // should not happen - let entryEl = el.closest('.hotspot-entry'); - target = entryEl.getAttribute('data-target'); - } - window.location.assign(target); - }); + if (page == "home") { + live('.hotspot-entry', 'click', function(el, ev){ + ev.preventDefault(); + ev.stopPropagation(); + let target = ''; + if (hasClass(el, 'hotspot-entry')) { + target = el.getAttribute('data-target'); + } else { // should not happen + let entryEl = el.closest('.hotspot-entry'); + target = entryEl.getAttribute('data-target'); + } + window.location.assign(target); + }); + } var filter = new Filtering();