restore compatibility

pull/134/head
Aevann 2023-02-24 09:31:12 +02:00
parent ae26306846
commit 6482a46955
1 changed files with 13 additions and 3 deletions

View File

@ -260,9 +260,19 @@ function changename(s1,s2) {
}
function showmore(t) {
const div = t.parentElement.nextElementSibling
div.classList.toggle('d-none')
if (div.classList.contains('d-none'))
let div = t
while (!(div.id && (div.id.startsWith('comment-text-') || div.id == 'post-text'))){
div = div.parentElement
}
let text = div.getElementsByTagName('d')[0]
if (!text) text = div.getElementsByClassName('showmore-text')[0]
if (!text) text = div.getElementsByClassName('d-none')[0]
text.classList.add('showmore-text')
text.classList.toggle('d-none')
if (text.classList.contains('d-none'))
t.innerHTML = 'SHOW MORE'
else
t.innerHTML = 'SHOW LESS'