From 3b462377ce608e42b5fb00b48ab1d86ed0c1d8e8 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sun, 24 Nov 2024 09:19:58 +1300 Subject: [PATCH] move post teaser clickable div so voting buttons still work --- app/static/js/scripts.js | 2 +- app/static/styles.css | 3 +++ app/static/styles.scss | 4 ++++ app/templates/post/post_teaser/_article.html | 4 ++-- app/templates/post/post_teaser/_link.html | 4 ++-- app/templates/post/post_teaser/_poll.html | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/static/js/scripts.js b/app/static/js/scripts.js index ebc772bf..ae9bac26 100644 --- a/app/static/js/scripts.js +++ b/app/static/js/scripts.js @@ -39,7 +39,7 @@ document.addEventListener("DOMContentLoaded", function () { function setupPostTeaserHandler() { document.querySelectorAll('.post_teaser_clickable').forEach(div => { div.onclick = function() { - const firstAnchor = this.querySelector('a'); + const firstAnchor = this.parentElement.querySelector('a'); if (firstAnchor) { window.location.href = firstAnchor.href; } diff --git a/app/static/styles.css b/app/static/styles.css index 057ec4ba..cfe92b65 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -867,6 +867,9 @@ div.navbar { .post_list .post_teaser.blocked .voting_buttons .upvote_button, .post_list .post_teaser.blocked .voting_buttons .downvote_button { font-size: 80%; } +.post_list .post_teaser .post_teaser_clickable { + cursor: pointer; +} .post_teaser_body { position: relative; diff --git a/app/static/styles.scss b/app/static/styles.scss index 8c3bff6f..7b17739f 100644 --- a/app/static/styles.scss +++ b/app/static/styles.scss @@ -460,6 +460,10 @@ div.navbar { } } } + + .post_teaser_clickable { + cursor: pointer; + } } } diff --git a/app/templates/post/post_teaser/_article.html b/app/templates/post/post_teaser/_article.html index ba363f1e..70f3fc55 100644 --- a/app/templates/post/post_teaser/_article.html +++ b/app/templates/post/post_teaser/_article.html @@ -1,4 +1,4 @@ -