diff --git a/web/src/app/css/base.css b/web/src/app/css/base.css index 9e5a452..208b06e 100644 --- a/web/src/app/css/base.css +++ b/web/src/app/css/base.css @@ -35,6 +35,9 @@ body { .collapse.collapsed { display: none !important; } +*[collapsed="true"]::before { + content: '... '; +} @media (max-width: 400px) { .media-max400 { display: none } } @media (max-width: 500px) { .media-max500 { display: none } } diff --git a/web/src/app/js/app.js b/web/src/app/js/app.js index c605c69..aebf22e 100644 --- a/web/src/app/js/app.js +++ b/web/src/app/js/app.js @@ -125,17 +125,19 @@ app.post = { return app.post._collapsed[id] === true; }, collapse: function(id, strs) { - const co = document.getElementById('collapse-'+id); - const cl = document.getElementById('collapse-link-'+id); + const co = document.querySelector(`#collapse-${id}`); + const cl = document.querySelector(`#collapse-link-${id} .link`); const collapsed = co.classList.contains('collapsed'); if (collapsed) { app.post._collapsed[id] = false; co.classList.remove('collapsed'); cl.innerText = strs[1]; + cl.parentNode.removeAttribute('collapsed'); } else { app.post._collapsed[id] = true; co.classList.add('collapsed'); cl.innerText = strs[0]; + cl.parentNode.setAttribute('collapsed', 'true'); } }, prepare4html: function(value, tags) { diff --git a/web/src/app/js/pages/meet.js b/web/src/app/js/pages/meet.js index c04a91c..8ec28e4 100644 --- a/web/src/app/js/pages/meet.js +++ b/web/src/app/js/pages/meet.js @@ -103,8 +103,8 @@ app.pages.meet = { const t1 = (app.strings.app.view_more || 'view more').replaceAll(/('|")/g, ''); const t2 = (app.strings.app.view_less || 'view less').replaceAll(/('|")/g, ''); const act = `app.post.collapse('${id}', ['${t1}', '${t2}'])`; - value = value.substr(0, gi)+ ''+ ' ver más'; + value = value.substr(0, gi)+ ` ${t1}`; ptext.innerHTML = value; if (!app.post.collapsed(id, true)) app.post.collapse(id, [t1, t2]);