Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
59.1
edited by Super Admin
on 2026/03/17 14:19
on 2026/03/17 14:19
Change comment:
There is no comment for this version
To version
57.1
edited by Super Admin
on 2026/03/17 13:41
on 2026/03/17 13:41
Change comment:
There is no comment for this version
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1005,19 +1005,15 @@ 1005 1005 } 1006 1006 // 長文投稿の折りたたみ初期化 1007 1007 document.querySelectorAll('.thread-post-body').forEach(function(body) { 1008 - // 先にtruncatedを仮適用してline-clampを有効にし、高さの差分で判定 1009 - var fullH = body.scrollHeight; 1010 - body.classList.add('truncated'); 1011 - var clampedH = body.clientHeight; 1012 - body.classList.remove('truncated'); 1013 - if (fullH > clampedH + 10) { 1008 + // 画像・ファイル添付を除いたテキスト部分の高さを判定 1009 + if (body.scrollHeight > body.clientHeight + 10 || body.textContent.length > 300) { 1014 1014 body.classList.add('truncated'); 1015 1015 var btn = document.createElement('button'); 1016 1016 btn.className = 'btn-read-more'; 1017 - btn.textContent = ' 広げて読む ▼';1013 + btn.textContent = '続きを読む ▼'; 1018 1018 btn.addEventListener('click', function() { 1019 1019 var isExpanded = body.classList.toggle('expanded'); 1020 - btn.textContent = isExpanded ? '折りたたむ ▲' : ' 広げて読む ▼';1016 + btn.textContent = isExpanded ? '折りたたむ ▲' : '続きを読む ▼'; 1021 1021 }); 1022 1022 body.parentNode.insertBefore(btn, body.nextSibling); 1023 1023 }