mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
tap anywhere on the teaser to view the post
not just the title
This commit is contained in:
parent
81c7f05e74
commit
f8638cf98b
4 changed files with 15 additions and 3 deletions
|
@ -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");
|
||||
|
||||
|
|
|
@ -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 -%}
|
||||
|
|
|
@ -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') -%}
|
||||
|
|
|
@ -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 -%}
|
||||
|
|
Loading…
Add table
Reference in a new issue