accomodate last commit

pull/143/head
Aevann 2023-04-29 17:55:35 +02:00
parent 2647019dc9
commit 2d41ee8a76
2 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,17 @@
function changeIcon(id) {
function expandText(id) {
const toggling = document.getElementById('post-text-'+id)
const attr = "d-none";
if (toggling.classList.contains(attr)) {
document.querySelectorAll(".toggled-visible").forEach(i => {
i.classList.add(attr)
i.classList.remove("toggled-visible")
});
toggling.classList.add("toggled-visible")
}
toggling.classList.toggle(attr);
for (const e of document.getElementsByClassName('text-expand-icon-p_'+id))
{
e.classList.toggle('fa-expand-alt');

View File

@ -116,7 +116,7 @@
<div class="d-flex" style="flex-basis:146px"></div>
<ul class="list-inline text-right d-flex">
{% if p.realbody(v, listing=True) %}
<button type="button" class="list-inline-item ml-2" data-nonce="{{g.nonce}}" data-onclick="changeIcon('{{p.id}}')" data-toggleelement="#post-text-{{p.id}}" data-toggleattr="d-none"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.fullname}}"></i></button>
<button type="button" class="list-inline-item ml-2" data-nonce="{{g.nonce}}" data-onclick="expandText('{{p.id}}')"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.fullname}}"></i></button>
{% endif %}
<a class="list-inline-item" {% if v and v.newtab %}data-target="t" target="_blank"{% endif %} href="{{p.permalink}}">
<i class="fas fa-comment-dots mr-2"></i>{{p.comment_count}}
@ -144,7 +144,7 @@
</li>
{% if p.realbody(v, listing=True) %}
<button type="button" class="list-inline-item ml-2" data-nonce="{{g.nonce}}" data-onclick="changeIcon('{{p.id}}')" data-toggleelement="#post-text-{{p.id}}" data-toggleattr="d-none"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.fullname}}"></i></button>
<button type="button" class="list-inline-item ml-2" data-nonce="{{g.nonce}}" data-onclick="expandText('{{p.id}}')"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.fullname}}"></i></button>
{% endif %}
{% if v %}