Browse Source

limit characters soustitre

ouidade 1 tuần trước cách đây
mục cha
commit
6be557a424

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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;
+      }
+    });
+  });
+

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác