소스 검색

limit characters soustitre

ouidade 1 주 전
부모
커밋
6be557a424
2개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 0 0
      web/themes/custom/eql/dist/assets/bundle.js
  2. 14 0
      web/themes/custom/eql/scripts/main.js

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
web/themes/custom/eql/dist/assets/bundle.js


+ 14 - 0
web/themes/custom/eql/scripts/main.js

@@ -287,3 +287,17 @@ document.addEventListener('DOMContentLoaded', () => {
 //   }
 // });
 
+// ////////////////// start tronquage sous titre  //////////////////
+  document.addEventListener("DOMContentLoaded", function () {
+    const maxLength = 80;
+
+    document.querySelectorAll('.view-base-de-donnees .wrapper-ressource .field--name-field-sous-titre').forEach(function (element) {
+      const fullText = element.textContent.trim();
+
+      if (fullText.length > maxLength) {
+        const truncated = fullText.slice(0, maxLength).trim() + '...';
+        element.textContent = truncated;
+      }
+    });
+  });
+

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.