|
@@ -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;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|