forked from MarseyWorld/MarseyWorld
fix this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4064078#context
parent
a059606fc6
commit
0b887043fa
|
@ -144,7 +144,7 @@ function register_new_elements(e) {
|
|||
|
||||
const onclick = e.querySelectorAll('[data-onclick]');
|
||||
for (const element of onclick) {
|
||||
element.onclick = () => {execute(element, 'onclick')};
|
||||
element.addEventListener("click", () => {execute(element, 'onclick')});
|
||||
}
|
||||
|
||||
const textareas = e.getElementsByTagName('textarea')
|
||||
|
@ -169,7 +169,9 @@ bs_trigger(document);
|
|||
|
||||
|
||||
document.addEventListener("click", function(e){
|
||||
const element = e.target
|
||||
let element = e.target
|
||||
if (element.tagName == "I")
|
||||
element = element.parentElement
|
||||
|
||||
if (element instanceof HTMLImageElement && (element.alt.startsWith('![](')) || element.classList.contains('in-comment-image') || element.classList.contains('img')) {
|
||||
expandImage()
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
function expandText(id) {
|
||||
document.querySelectorAll(".toggled-visible").forEach(i => {
|
||||
i.classList.add("d-none")
|
||||
i.classList.remove("toggled-visible")
|
||||
});
|
||||
const toggling = document.getElementById('post-text-'+id)
|
||||
toggling.classList.toggle('d-none');
|
||||
toggling.classList.add("toggled-visible")
|
||||
|
||||
function changeIcon(id) {
|
||||
for (const e of document.getElementsByClassName('text-expand-icon-p_'+id))
|
||||
{
|
||||
e.classList.toggle('fa-expand-alt');
|
||||
|
|
|
@ -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="expandText('{{p.id}}')"><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="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>
|
||||
{% 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="expandText('{{p.id}}')"><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="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>
|
||||
{% endif %}
|
||||
|
||||
{% if v %}
|
||||
|
|
Loading…
Reference in New Issue