tap anywhere on the teaser to view the post

not just the title
This commit is contained in:
rimu 2024-11-22 08:47:34 +13:00
parent 81c7f05e74
commit f8638cf98b
4 changed files with 15 additions and 3 deletions

View file

@ -33,8 +33,20 @@ document.addEventListener("DOMContentLoaded", function () {
setupShowElementLinks();
setupLightboxTeaser();
setupLightboxPostBody();
setupPostTeaserHandler();
});
function setupPostTeaserHandler() {
document.querySelectorAll('.post_teaser_clickable').forEach(div => {
div.onclick = function() {
const firstAnchor = this.querySelector('a');
if (firstAnchor) {
window.location.href = firstAnchor.href;
}
};
});
}
function setupYouTubeLazyLoad() {
const lazyVideos = document.querySelectorAll(".video-wrapper");

View file

@ -1,4 +1,4 @@
<div class="col post_teaser_body">
<div class="col post_teaser_body post_teaser_clickable">
<h3>{% if post.sticky -%}<span class="fe fe-sticky-left"></span>{% endif -%}<a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None) }}" class="post_teaser_title_a">{{ post.title }}</a>
{% if post.nsfw -%}<span class="warning_badge nsfw" title="{{ _('Not safe for work') }}">nsfw</span>{% endif -%}
{% if post.nsfl -%}<span class="warning_badge nsfl" title="{{ _('Potentially emotionally scarring content') }}">nsfl</span>{% endif -%}

View file

@ -1,4 +1,4 @@
<div class="col post_teaser_body">
<div class="col post_teaser_body post_teaser_clickable">
<h3>{% if post.sticky -%}<span class="fe fe-sticky-left"></span>{% endif -%}<a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None) }}" class="post_teaser_title_a">{{ post.title }}</a>
{% if post.domain_id -%}
{% if post.url.endswith('.mp3') -%}

View file

@ -1,4 +1,4 @@
<div class="col post_teaser_body">
<div class="col post_teaser_body post_teaser_clickable">
<h3>{% if post.sticky -%}<span class="fe fe-sticky-left"></span>{% endif -%}<a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None) }}" class="post_teaser_title_a">{{ post.title }}</a>
<span class="fe fe-poll" aria-hidden="true"> </span>
{% if post.nsfw -%}<span class="warning_badge nsfw" title="{{ _('Not safe for work') }}">nsfw</span>{% endif -%}