ssb: Indicate that content warnings can be expanded.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m38s

This commit is contained in:
Cory McWilliams 2025-04-24 12:35:36 -04:00
parent 97cea7b40b
commit 8d961cd805
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&Zv/eOewtUPxYuALmYV8v+JDKwH4+aN8zCTYFwB7oYEw=.sha256" "previous": "&OZ/C4IMnH3MU1FTsImb1u25m1I8Wjic2SsEfMbJeCq8=.sha256"
} }

View File

@ -306,6 +306,10 @@ class TfMessageElement extends LitElement {
); );
} }
is_expanded(tag) {
return this.expanded[(this.message.id || '') + (tag || '')];
}
render_children() { render_children() {
let self = this; let self = this;
if (this.message.child_messages?.length) { if (this.message.child_messages?.length) {
@ -678,11 +682,12 @@ class TfMessageElement extends LitElement {
} }
let content_warning = html` let content_warning = html`
<div <div
class="w3-panel w3-round-xlarge w3-theme-l4" class="w3-panel w3-round-xlarge w3-theme-l4 w3"
style="cursor: pointer" style="cursor: pointer"
@click=${(x) => this.toggle_expanded(':cw')} @click=${(x) => this.toggle_expanded(':cw')}
> >
<p>${content.contentWarning}</p> <p>${content.contentWarning}</p>
<p class="w3-small">${this.is_expanded(':cw') ? 'Show less' : 'Show more'}</p>
</div> </div>
`; `;
let content_html = html` let content_html = html`