Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
68.1
edited by Super Admin
on 2026/03/18 11:28
on 2026/03/18 11:28
Change comment:
There is no comment for this version
To version
66.1
edited by Super Admin
on 2026/03/18 09:18
on 2026/03/18 09:18
Change comment:
There is no comment for this version
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1075,15 +1075,14 @@ 1075 1075 document.querySelectorAll('.activity-thread-header').forEach(function(header) { 1076 1076 header.addEventListener('click', toggleThreadExpand); 1077 1077 }); 1078 - // 長文投稿の折りたたみ初期化 (max-height: 12em 超で省略)1078 + // 長文投稿の折りたたみ初期化 1079 1079 document.querySelectorAll('.thread-post-body').forEach(function(body) { 1080 - // pre-wrapのまま高さを測定し、max-height(12em≒ ~200px)を超える場合に折りたたむ1080 + // 先にtruncatedを仮適用してline-clampを有効にし、高さの差分で判定 1081 1081 var fullH = body.scrollHeight; 1082 - // 12em を px に変換(font-size × line-height × 行数 の近似値ではなくCSSと同じ値を取得) 1083 1083 body.classList.add('truncated'); 1084 - var maxH = body.clientHeight;// max-height: 12em 適用後の高さ1083 + var clampedH = body.clientHeight; 1085 1085 body.classList.remove('truncated'); 1086 - if (fullH > maxH +30) {1085 + if (fullH > clampedH + 10) { 1087 1087 body.classList.add('truncated'); 1088 1088 var btn = document.createElement('button'); 1089 1089 btn.className = 'btn-read-more';