Skip to content

Commit

Permalink
Fixed #6: goto content on card click only for Home, not downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Apr 22, 2024
1 parent 603fd2a commit cb9a010
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions assets/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit cb9a010

Please sign in to comment.